Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/cineon/cineon_dpx.c')
-rw-r--r--source/blender/imbuf/intern/cineon/cineon_dpx.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index ba84063f317..48bda418d82 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -70,30 +70,23 @@ static struct ImBuf *imb_load_dpx_cineon(unsigned char *mem, size_t size, int us
logImageGetSize(image, &width, &height, &depth);
- if (width == 0 || height == 0) {
- logImageClose(image);
- return 0;
- }
-
ibuf = IMB_allocImBuf(width, height, 32, IB_rectfloat | flags);
if (ibuf == 0) {
logImageClose(image);
return 0;
}
- if (logImageGetDataRGBA(image, ibuf->rect_float, 1) != 0) {
- /* Conversion not possible (probably because the format is unsupported) */
- logImageClose(image);
- MEM_freeN(ibuf);
- return 0;
+ if (!(flags & IB_test)) {
+ if (logImageGetDataRGBA(image, ibuf->rect_float, 1) != 0) {
+ logImageClose(image);
+ IMB_freeImBuf(ibuf);
+ return 0;
+ }
+ IMB_flipy(ibuf);
}
logImageClose(image);
ibuf->ftype = use_cineon ? CINEON : DPX;
- IMB_flipy(ibuf);
-
- if (flags & IB_rect)
- IMB_rect_from_float(ibuf);
if (flags & IB_alphamode_detect)
ibuf->flags |= IB_alphamode_premul;
@@ -141,7 +134,7 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
if (ibuf->rect_float != 0 && bitspersample != 8) {
/* don't use the float buffer to save 8 bpp picture to prevent color banding
- (there's no dithering algorithm behing the logImageSetDataRGBA function) */
+ * (there's no dithering algorithm behing the logImageSetDataRGBA function) */
fbuf = (float *)MEM_mallocN(ibuf->x * ibuf->y * 4 * sizeof(float), "fbuf in imb_save_dpx_cineon");