Fix [#20821] COLOR MANAGEMENT: Corrupts motion picture files
authorMatt Ebb <matt@mke3.net>
Tue, 26 Jan 2010 02:49:30 +0000 (02:49 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 26 Jan 2010 02:49:30 +0000 (02:49 +0000)
Wasn't tagging movie formats with profiles properly.

source/blender/imbuf/intern/anim.c
source/blender/imbuf/intern/anim5.c
source/blender/quicktime/apple/qtkit_import.m
source/blender/quicktime/apple/quicktime_import.c

index 1aaba620f3aa27ea0de763ff8152f1d081d41c29..effc91739c0fa93e3d2efc500442858df31613df 100644 (file)
@@ -504,6 +504,8 @@ static ImBuf * avi_fetchibuf (struct anim *anim, int position) {
                MEM_freeN (tmp);
        }
 
+       ibuf->profile = IB_PROFILE_SRGB;
+               
        return ibuf;
 }
 
@@ -881,6 +883,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) {
                IMB_filtery(ibuf);
        }
 
+       ibuf->profile = IB_PROFILE_SRGB;
+       
        return(ibuf);
 }
 
@@ -1069,6 +1073,7 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) {
                        if (nextanim5(anim)) return (0);
                }
                ibuf = anim5_fetchibuf(anim);
+               ibuf->profile = IB_PROFILE_SRGB;
                break;
        case ANIM_SEQUENCE:
                pic = an_stringdec(anim->first, head, tail, &digits);
@@ -1089,22 +1094,26 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) {
                if (ibuf) {
                        anim->curposition = position;
                        IMB_convert_rgba_to_abgr(ibuf);
+                       ibuf->profile = IB_PROFILE_SRGB;
                }
                break;
        case ANIM_AVI:
                ibuf = avi_fetchibuf(anim, position);
-               if (ibuf) anim->curposition = position;
+               if (ibuf)
+                       anim->curposition = position;
                break;
 #ifdef WITH_QUICKTIME
        case ANIM_QTIME:
                ibuf = qtime_fetchibuf(anim, position);
-               if (ibuf) anim->curposition = position;
+               if (ibuf)
+                       anim->curposition = position;
                break;
 #endif
 #ifdef WITH_FFMPEG
        case ANIM_FFMPEG:
                ibuf = ffmpeg_fetchibuf(anim, position);
-               if (ibuf) anim->curposition = position;
+               if (ibuf)
+                       anim->curposition = position;
                filter_y = 0; /* done internally */
                break;
 #endif
index 43a6b0d2c5df977b8b0220a05acef673968311d4..7aaaee36e9a1073d50d4da1c0bf64afadb48256c 100644 (file)
@@ -532,6 +532,8 @@ struct ImBuf * anim5_fetchibuf(struct anim * anim) {
        ibuf = IMB_dupImBuf(anim->ibuf1);
        planes_to_rect(ibuf, anim->ib_flags);
 
+       ibuf->profile = IB_PROFILE_SRGB;
+       
        return(ibuf);
 }
 
index 31a6ca71259ea96edb7b5a2eb68475b09697dad1..40d57552fb62982f92879fce968dd1c821a1ab79 100644 (file)
@@ -281,6 +281,8 @@ ImBuf * qtime_fetchibuf (struct anim *anim, int position)
 
        ibuf = nsImageToiBuf(frameImage,anim->x, anim->y);
        [pool drain];
+       
+       ibuf->profile = IB_PROFILE_SRGB;
        return ibuf;
 }
 
index 6fd72131b004b86f20cb994a27b2e91ec6d3a297..655271b505528e1ce8b6a8209e4a9c7148021470 100644 (file)
@@ -373,6 +373,8 @@ ImBuf * qtime_fetchibuf (struct anim *anim, int position)
        }
 #endif
 
+       ibuf->profile == IB_PROFILE_SRGB;
+       
        IMB_flipy(ibuf);
        return ibuf;
 }