cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 | % % |
| 4 | % % |
| 5 | % % |
| 6 | % AAA V V SSSSS % |
| 7 | % A A V V SS % |
| 8 | % AAAAA V V SSS % |
| 9 | % A A V V SS % |
| 10 | % A A V SSSSS % |
| 11 | % % |
| 12 | % % |
| 13 | % Read/Write AVS X Image Format % |
| 14 | % % |
| 15 | % Software Design % |
cristy | de984cd | 2013-12-01 14:49:27 +0000 | [diff] [blame] | 16 | % Cristy % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 17 | % July 1992 % |
| 18 | % % |
| 19 | % % |
cristy | b56bb24 | 2014-11-25 17:12:48 +0000 | [diff] [blame^] | 20 | % Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 21 | % dedicated to making software imaging solutions freely available. % |
| 22 | % % |
| 23 | % You may not use this file except in compliance with the License. You may % |
| 24 | % obtain a copy of the License at % |
| 25 | % % |
| 26 | % http://www.imagemagick.org/script/license.php % |
| 27 | % % |
| 28 | % Unless required by applicable law or agreed to in writing, software % |
| 29 | % distributed under the License is distributed on an "AS IS" BASIS, % |
| 30 | % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % |
| 31 | % See the License for the specific language governing permissions and % |
| 32 | % limitations under the License. % |
| 33 | % % |
| 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 35 | % |
| 36 | % |
| 37 | */ |
| 38 | |
| 39 | /* |
| 40 | Include declarations. |
| 41 | */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 42 | #include "MagickCore/studio.h" |
| 43 | #include "MagickCore/blob.h" |
| 44 | #include "MagickCore/blob-private.h" |
| 45 | #include "MagickCore/cache.h" |
| 46 | #include "MagickCore/colorspace.h" |
cristy | 510d06a | 2011-07-06 23:43:54 +0000 | [diff] [blame] | 47 | #include "MagickCore/colorspace-private.h" |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 48 | #include "MagickCore/exception.h" |
| 49 | #include "MagickCore/exception-private.h" |
| 50 | #include "MagickCore/image.h" |
| 51 | #include "MagickCore/image-private.h" |
| 52 | #include "MagickCore/list.h" |
| 53 | #include "MagickCore/magick.h" |
| 54 | #include "MagickCore/memory_.h" |
| 55 | #include "MagickCore/monitor.h" |
| 56 | #include "MagickCore/monitor-private.h" |
| 57 | #include "MagickCore/pixel-accessor.h" |
| 58 | #include "MagickCore/quantum-private.h" |
| 59 | #include "MagickCore/static.h" |
| 60 | #include "MagickCore/string_.h" |
| 61 | #include "MagickCore/module.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 62 | |
| 63 | /* |
| 64 | Forward declarations. |
| 65 | */ |
| 66 | static MagickBooleanType |
cristy | 1e178e7 | 2011-08-28 19:44:34 +0000 | [diff] [blame] | 67 | WriteAVSImage(const ImageInfo *,Image *,ExceptionInfo *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 68 | |
| 69 | /* |
| 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 71 | % % |
| 72 | % % |
| 73 | % % |
| 74 | % R e a d A V S I m a g e % |
| 75 | % % |
| 76 | % % |
| 77 | % % |
| 78 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 79 | % |
| 80 | % ReadAVSImage() reads an AVS X image file and returns it. It |
| 81 | % allocates the memory necessary for the new Image structure and returns a |
| 82 | % pointer to the new image. |
| 83 | % |
| 84 | % The format of the ReadAVSImage method is: |
| 85 | % |
| 86 | % Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception) |
| 87 | % |
| 88 | % A description of each parameter follows: |
| 89 | % |
| 90 | % o image_info: the image info. |
| 91 | % |
| 92 | % o exception: return any errors or warnings in this structure. |
| 93 | % |
| 94 | */ |
| 95 | static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception) |
| 96 | { |
| 97 | Image |
| 98 | *image; |
| 99 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 100 | MagickBooleanType |
| 101 | status; |
| 102 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 103 | register Quantum |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 104 | *q; |
| 105 | |
cristy | bdadf31 | 2011-04-23 23:16:21 +0000 | [diff] [blame] | 106 | register ssize_t |
| 107 | x; |
| 108 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 109 | register unsigned char |
| 110 | *p; |
| 111 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 112 | size_t |
cristy | e179ce2 | 2010-09-16 23:46:34 +0000 | [diff] [blame] | 113 | height, |
| 114 | length, |
| 115 | width; |
| 116 | |
| 117 | ssize_t |
| 118 | count, |
| 119 | y; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 120 | |
| 121 | unsigned char |
| 122 | *pixels; |
| 123 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 124 | /* |
| 125 | Open image file. |
| 126 | */ |
| 127 | assert(image_info != (const ImageInfo *) NULL); |
| 128 | assert(image_info->signature == MagickSignature); |
| 129 | if (image_info->debug != MagickFalse) |
| 130 | (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", |
| 131 | image_info->filename); |
| 132 | assert(exception != (ExceptionInfo *) NULL); |
| 133 | assert(exception->signature == MagickSignature); |
cristy | 9950d57 | 2011-10-01 18:22:35 +0000 | [diff] [blame] | 134 | image=AcquireImage(image_info,exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 135 | status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); |
| 136 | if (status == MagickFalse) |
| 137 | { |
| 138 | image=DestroyImageList(image); |
| 139 | return((Image *) NULL); |
| 140 | } |
| 141 | /* |
| 142 | Read AVS X image. |
| 143 | */ |
cristy | 8a46d82 | 2012-08-28 23:32:39 +0000 | [diff] [blame] | 144 | image->alpha_trait=BlendPixelTrait; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 145 | width=ReadBlobMSBLong(image); |
| 146 | height=ReadBlobMSBLong(image); |
| 147 | if (EOFBlob(image) != MagickFalse) |
| 148 | ThrowReaderException(CorruptImageError,"ImproperImageHeader"); |
| 149 | if ((width == 0UL) || (height == 0UL)) |
| 150 | ThrowReaderException(CorruptImageError,"ImproperImageHeader"); |
| 151 | do |
| 152 | { |
| 153 | /* |
| 154 | Convert AVS raster image to pixel packets. |
| 155 | */ |
| 156 | image->columns=width; |
| 157 | image->rows=height; |
| 158 | image->depth=8; |
| 159 | if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) |
| 160 | if (image->scene >= (image_info->scene+image_info->number_scenes-1)) |
| 161 | break; |
| 162 | pixels=(unsigned char *) AcquireQuantumMemory(image->columns, |
| 163 | 4*sizeof(*pixels)); |
| 164 | if (pixels == (unsigned char *) NULL) |
| 165 | ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); |
| 166 | length=(size_t) 4*image->columns; |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 167 | for (y=0; y < (ssize_t) image->rows; y++) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 168 | { |
| 169 | count=ReadBlob(image,length,pixels); |
| 170 | if ((size_t) count != length) |
| 171 | ThrowReaderException(CorruptImageError,"UnableToReadImageData"); |
| 172 | p=pixels; |
| 173 | q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); |
cristy | acd2ed2 | 2011-08-30 01:44:23 +0000 | [diff] [blame] | 174 | if (q == (Quantum *) NULL) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 175 | break; |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 176 | for (x=0; x < (ssize_t) image->columns; x++) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 177 | { |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 178 | SetPixelAlpha(image,ScaleCharToQuantum(*p++),q); |
| 179 | SetPixelRed(image,ScaleCharToQuantum(*p++),q); |
| 180 | SetPixelGreen(image,ScaleCharToQuantum(*p++),q); |
| 181 | SetPixelBlue(image,ScaleCharToQuantum(*p++),q); |
cristy | ed23157 | 2011-07-14 02:18:59 +0000 | [diff] [blame] | 182 | q+=GetPixelChannels(image); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 183 | } |
| 184 | if (SyncAuthenticPixels(image,exception) == MagickFalse) |
| 185 | break; |
cristy | bdadf31 | 2011-04-23 23:16:21 +0000 | [diff] [blame] | 186 | if (image->previous == (Image *) NULL) |
| 187 | { |
| 188 | status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, |
| 189 | image->rows); |
| 190 | if (status == MagickFalse) |
| 191 | break; |
| 192 | } |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 193 | } |
| 194 | pixels=(unsigned char *) RelinquishMagickMemory(pixels); |
| 195 | if (EOFBlob(image) != MagickFalse) |
| 196 | { |
| 197 | ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", |
| 198 | image->filename); |
| 199 | break; |
| 200 | } |
| 201 | /* |
| 202 | Proceed to next image. |
| 203 | */ |
| 204 | if (image_info->number_scenes != 0) |
| 205 | if (image->scene >= (image_info->scene+image_info->number_scenes-1)) |
| 206 | break; |
| 207 | width=ReadBlobMSBLong(image); |
| 208 | height=ReadBlobMSBLong(image); |
| 209 | if ((width != 0UL) && (height != 0UL)) |
| 210 | { |
| 211 | /* |
| 212 | Allocate next image structure. |
| 213 | */ |
cristy | 9950d57 | 2011-10-01 18:22:35 +0000 | [diff] [blame] | 214 | AcquireNextImage(image_info,image,exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 215 | if (GetNextImageInList(image) == (Image *) NULL) |
| 216 | { |
| 217 | image=DestroyImageList(image); |
| 218 | return((Image *) NULL); |
| 219 | } |
| 220 | image=SyncNextImageInList(image); |
| 221 | status=SetImageProgress(image,LoadImagesTag,TellBlob(image), |
| 222 | GetBlobSize(image)); |
| 223 | if (status == MagickFalse) |
| 224 | break; |
| 225 | } |
| 226 | } while ((width != 0UL) && (height != 0UL)); |
| 227 | (void) CloseBlob(image); |
| 228 | return(GetFirstImageInList(image)); |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 233 | % % |
| 234 | % % |
| 235 | % % |
| 236 | % R e g i s t e r A V S I m a g e % |
| 237 | % % |
| 238 | % % |
| 239 | % % |
| 240 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 241 | % |
| 242 | % RegisterAVSImage() adds attributes for the AVS X image format to the list |
| 243 | % of supported formats. The attributes include the image format tag, a |
| 244 | % method to read and/or write the format, whether the format supports the |
| 245 | % saving of more than one frame to the same file or blob, whether the format |
| 246 | % supports native in-memory I/O, and a brief description of the format. |
| 247 | % |
| 248 | % The format of the RegisterAVSImage method is: |
| 249 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 250 | % size_t RegisterAVSImage(void) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 251 | % |
| 252 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 253 | ModuleExport size_t RegisterAVSImage(void) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 254 | { |
| 255 | MagickInfo |
| 256 | *entry; |
| 257 | |
| 258 | entry=SetMagickInfo("AVS"); |
| 259 | entry->decoder=(DecodeImageHandler *) ReadAVSImage; |
| 260 | entry->encoder=(EncodeImageHandler *) WriteAVSImage; |
| 261 | entry->description=ConstantString("AVS X image"); |
| 262 | entry->module=ConstantString("AVS"); |
| 263 | (void) RegisterMagickInfo(entry); |
| 264 | return(MagickImageCoderSignature); |
| 265 | } |
| 266 | |
| 267 | /* |
| 268 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 269 | % % |
| 270 | % % |
| 271 | % % |
| 272 | % U n r e g i s t e r A V S I m a g e % |
| 273 | % % |
| 274 | % % |
| 275 | % % |
| 276 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 277 | % |
| 278 | % UnregisterAVSImage() removes format registrations made by the |
| 279 | % AVS module from the list of supported formats. |
| 280 | % |
| 281 | % The format of the UnregisterAVSImage method is: |
| 282 | % |
| 283 | % UnregisterAVSImage(void) |
| 284 | % |
| 285 | */ |
| 286 | ModuleExport void UnregisterAVSImage(void) |
| 287 | { |
| 288 | (void) UnregisterMagickInfo("AVS"); |
| 289 | } |
| 290 | |
| 291 | /* |
| 292 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 293 | % % |
| 294 | % % |
| 295 | % % |
| 296 | % W r i t e A V S I m a g e % |
| 297 | % % |
| 298 | % % |
| 299 | % % |
| 300 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 301 | % |
| 302 | % WriteAVSImage() writes an image to a file in AVS X image format. |
| 303 | % |
| 304 | % The format of the WriteAVSImage method is: |
| 305 | % |
cristy | 1e178e7 | 2011-08-28 19:44:34 +0000 | [diff] [blame] | 306 | % MagickBooleanType WriteAVSImage(const ImageInfo *image_info, |
| 307 | % Image *image,ExceptionInfo *exception) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 308 | % |
| 309 | % A description of each parameter follows. |
| 310 | % |
| 311 | % o image_info: the image info. |
| 312 | % |
| 313 | % o image: The image. |
| 314 | % |
cristy | 1e178e7 | 2011-08-28 19:44:34 +0000 | [diff] [blame] | 315 | % o exception: return any errors or warnings in this structure. |
| 316 | % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 317 | */ |
cristy | 1e178e7 | 2011-08-28 19:44:34 +0000 | [diff] [blame] | 318 | static MagickBooleanType WriteAVSImage(const ImageInfo *image_info,Image *image, |
| 319 | ExceptionInfo *exception) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 320 | { |
| 321 | MagickBooleanType |
| 322 | status; |
| 323 | |
| 324 | MagickOffsetType |
| 325 | scene; |
| 326 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 327 | register const Quantum |
cristy | 3f2302b | 2010-03-11 03:16:37 +0000 | [diff] [blame] | 328 | *restrict p; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 329 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 330 | register ssize_t |
cristy | 3f2302b | 2010-03-11 03:16:37 +0000 | [diff] [blame] | 331 | x; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 332 | |
| 333 | register unsigned char |
cristy | 3f2302b | 2010-03-11 03:16:37 +0000 | [diff] [blame] | 334 | *restrict q; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 335 | |
| 336 | ssize_t |
cristy | eda6083 | 2010-09-17 00:00:24 +0000 | [diff] [blame] | 337 | count, |
| 338 | y; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 339 | |
| 340 | unsigned char |
| 341 | *pixels; |
| 342 | |
| 343 | /* |
| 344 | Open output image file. |
| 345 | */ |
| 346 | assert(image_info != (const ImageInfo *) NULL); |
| 347 | assert(image_info->signature == MagickSignature); |
| 348 | assert(image != (Image *) NULL); |
| 349 | assert(image->signature == MagickSignature); |
| 350 | if (image->debug != MagickFalse) |
| 351 | (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); |
cristy | 3a37efd | 2011-08-28 20:31:03 +0000 | [diff] [blame] | 352 | assert(exception != (ExceptionInfo *) NULL); |
| 353 | assert(exception->signature == MagickSignature); |
cristy | 1e178e7 | 2011-08-28 19:44:34 +0000 | [diff] [blame] | 354 | status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 355 | if (status == MagickFalse) |
| 356 | return(status); |
| 357 | scene=0; |
| 358 | do |
| 359 | { |
| 360 | /* |
| 361 | Write AVS header. |
| 362 | */ |
cristy | af8d391 | 2014-02-21 14:50:33 +0000 | [diff] [blame] | 363 | (void) TransformImageColorspace(image,sRGBColorspace,exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 364 | (void) WriteBlobMSBLong(image,(unsigned int) image->columns); |
| 365 | (void) WriteBlobMSBLong(image,(unsigned int) image->rows); |
| 366 | /* |
| 367 | Allocate memory for pixels. |
| 368 | */ |
| 369 | pixels=(unsigned char *) AcquireQuantumMemory((size_t) image->columns, |
| 370 | 4*sizeof(*pixels)); |
| 371 | if (pixels == (unsigned char *) NULL) |
| 372 | ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); |
| 373 | /* |
| 374 | Convert MIFF to AVS raster pixels. |
| 375 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 376 | for (y=0; y < (ssize_t) image->rows; y++) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 377 | { |
cristy | 1e178e7 | 2011-08-28 19:44:34 +0000 | [diff] [blame] | 378 | p=GetVirtualPixels(image,0,y,image->columns,1,exception); |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 379 | if (p == (const Quantum *) NULL) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 380 | break; |
| 381 | q=pixels; |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 382 | for (x=0; x < (ssize_t) image->columns; x++) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 383 | { |
cristy | 0553bd5 | 2013-06-30 15:53:50 +0000 | [diff] [blame] | 384 | *q++=ScaleQuantumToChar((Quantum) (image->alpha_trait == |
| 385 | BlendPixelTrait ? GetPixelAlpha(image,p) : OpaqueAlpha)); |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 386 | *q++=ScaleQuantumToChar(GetPixelRed(image,p)); |
| 387 | *q++=ScaleQuantumToChar(GetPixelGreen(image,p)); |
| 388 | *q++=ScaleQuantumToChar(GetPixelBlue(image,p)); |
cristy | ed23157 | 2011-07-14 02:18:59 +0000 | [diff] [blame] | 389 | p+=GetPixelChannels(image); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 390 | } |
| 391 | count=WriteBlob(image,(size_t) (q-pixels),pixels); |
| 392 | if (count != (ssize_t) (q-pixels)) |
| 393 | break; |
cristy | bdadf31 | 2011-04-23 23:16:21 +0000 | [diff] [blame] | 394 | if (image->previous == (Image *) NULL) |
| 395 | { |
| 396 | status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, |
| 397 | image->rows); |
| 398 | if (status == MagickFalse) |
| 399 | break; |
| 400 | } |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 401 | } |
| 402 | pixels=(unsigned char *) RelinquishMagickMemory(pixels); |
| 403 | if (GetNextImageInList(image) == (Image *) NULL) |
| 404 | break; |
| 405 | image=SyncNextImageInList(image); |
| 406 | status=SetImageProgress(image,SaveImagesTag,scene++, |
| 407 | GetImageListLength(image)); |
| 408 | if (status == MagickFalse) |
| 409 | break; |
| 410 | } while (image_info->adjoin != MagickFalse); |
| 411 | (void) CloseBlob(image); |
| 412 | return(MagickTrue); |
| 413 | } |