202
218
No interlacing: YCbCrYCbCrYCbCrYCbCrYCbCrYCbCr...
204
for (y=0; y < image->extract_info.y; y++)
205
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
206
for (y=0; y < (long) image->rows; y++)
222
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
223
count=ReadBlob(image,length,pixels);
224
if (count != (ssize_t) length)
227
for (y=0; y < (long) image->extract_info.height; y++)
208
if ((y > 0) || (GetPreviousImageInList(image) == (Image *) NULL))
209
count=ReadBlob(image,packet_size*image->extract_info.width,
211
q=SetImagePixels(image,0,y,image->columns,1);
229
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
212
230
if (q == (PixelPacket *) NULL)
214
if (image->matte == MagickFalse)
215
(void) ExportQuantumPixels(image,&quantum_info,RGBQuantum,
218
(void) ExportQuantumPixels(image,&quantum_info,RGBAQuantum,
220
if (SyncImagePixels(image) == MagickFalse)
232
length=ImportQuantumPixels(canvas_image,quantum_info,quantum_type,
234
if (SyncImagePixels(canvas_image) == MagickFalse)
222
if (image->previous == (Image *) NULL)
223
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
224
(QuantumTick(y,image->rows) != MagickFalse))
236
if (((y-image->extract_info.y) >= 0) &&
237
((y-image->extract_info.y) < (long) image->rows))
239
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
240
canvas_image->columns,1,exception);
241
q=SetImagePixels(image,0,y-image->extract_info.y,image->columns,
243
if ((p == (const PixelPacket *) NULL) ||
244
(q == (PixelPacket *) NULL))
246
for (x=0; x < (long) image->columns; x++)
226
status=image->progress_monitor(LoadImageTag,y,image->rows,
228
if (status == MagickFalse)
251
if (image->matte != MagickFalse)
252
q->opacity=p->opacity;
256
if (SyncImagePixels(image) == MagickFalse)
259
if (image->previous == (Image *) NULL)
261
status=SetImageProgress(image,LoadImageTag,y,image->rows);
262
if (status == MagickFalse)
265
count=ReadBlob(image,length,pixels);
266
if (count != (ssize_t) length)
232
width=image->extract_info.height-image->rows-image->extract_info.y;
233
for (i=0; i < (long) width; i++)
234
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
237
271
case LineInterlace:
240
283
Line interlacing: YYY...CbCbCb...CrCrCr...YYY...CbCbCb...CrCrCr...
242
packet_size=(size_t) ((image->depth+7)/8);
243
for (y=0; y < image->extract_info.y; y++)
244
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
245
for (y=0; y < (long) image->rows; y++)
287
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
288
count=ReadBlob(image,length,pixels);
289
if (count != (ssize_t) length)
292
for (y=0; y < (long) image->extract_info.height; y++)
247
if ((y > 0) || (GetPreviousImageInList(image) == (Image *) NULL))
248
count=ReadBlob(image,packet_size*image->extract_info.width,
294
for (i=0; i < (image->matte != MagickFalse ? 4 : 3); i++)
296
quantum_type=quantum_types[i];
297
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
298
if (q == (PixelPacket *) NULL)
300
length=ImportQuantumPixels(canvas_image,quantum_info,quantum_type,
250
q=SetImagePixels(image,0,y,image->columns,1);
251
if (q == (PixelPacket *) NULL)
253
(void) ExportQuantumPixels(image,&quantum_info,RedQuantum,
255
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
256
(void) ExportQuantumPixels(image,&quantum_info,GreenQuantum,
258
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
259
(void) ExportQuantumPixels(image,&quantum_info,BlueQuantum,
261
if (image->matte != MagickFalse)
302
if (SyncImagePixels(canvas_image) == MagickFalse)
304
if (((y-image->extract_info.y) >= 0) &&
305
((y-image->extract_info.y) < (long) image->rows))
307
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,
308
0,canvas_image->columns,1,exception);
309
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
311
if ((p == (const PixelPacket *) NULL) ||
312
(q == (PixelPacket *) NULL))
314
for (x=0; x < (long) image->columns; x++)
316
switch (quantum_type)
318
case RedQuantum: q->red=p->red; break;
319
case GreenQuantum: q->green=p->green; break;
320
case BlueQuantum: q->blue=p->blue; break;
321
case OpacityQuantum: q->opacity=p->opacity; break;
327
if (SyncImagePixels(image) == MagickFalse)
330
count=ReadBlob(image,length,pixels);
331
if (count != (ssize_t) length)
334
if (image->previous == (Image *) NULL)
263
count=ReadBlob(image,packet_size*image->extract_info.width,
265
(void) ExportQuantumPixels(image,&quantum_info,AlphaQuantum,
336
status=SetImageProgress(image,LoadImageTag,y,image->rows);
337
if (status == MagickFalse)
268
if (SyncImagePixels(image) == MagickFalse)
270
if (image->previous == (Image *) NULL)
271
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
272
(QuantumTick(y,image->rows) != MagickFalse))
274
status=image->progress_monitor(LoadImageTag,y,image->rows,
276
if (status == MagickFalse)
280
width=image->extract_info.height-image->rows-image->extract_info.y;
281
for (i=0; i < (long) width; i++)
282
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
285
343
case PlaneInterlace:
346
Plane interlacing: YYYYYY...CbCbCbCbCbCb...CrCrCrCrCrCr...
350
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
351
count=ReadBlob(image,length,pixels);
352
if (count != (ssize_t) length)
355
for (y=0; y < (long) image->extract_info.height; y++)
357
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
358
if (q == (PixelPacket *) NULL)
360
length=ImportQuantumPixels(canvas_image,quantum_info,RedQuantum,
362
if (SyncImagePixels(canvas_image) == MagickFalse)
364
if (((y-image->extract_info.y) >= 0) &&
365
((y-image->extract_info.y) < (long) image->rows))
367
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
368
canvas_image->columns,1,exception);
369
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
371
if ((p == (const PixelPacket *) NULL) ||
372
(q == (PixelPacket *) NULL))
374
for (x=0; x < (long) image->columns; x++)
380
if (SyncImagePixels(image) == MagickFalse)
383
count=ReadBlob(image,length,pixels);
384
if (count != (ssize_t) length)
387
if (image->previous == (Image *) NULL)
389
status=SetImageProgress(image,LoadImageTag,1,5);
390
if (status == MagickFalse)
393
for (y=0; y < (long) image->extract_info.height; y++)
395
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
396
if (q == (PixelPacket *) NULL)
398
length=ImportQuantumPixels(canvas_image,quantum_info,GreenQuantum,
400
if (SyncImagePixels(canvas_image) == MagickFalse)
402
if (((y-image->extract_info.y) >= 0) &&
403
((y-image->extract_info.y) < (long) image->rows))
405
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
406
canvas_image->columns,1,exception);
407
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
409
if ((p == (const PixelPacket *) NULL) ||
410
(q == (PixelPacket *) NULL))
412
for (x=0; x < (long) image->columns; x++)
418
if (SyncImagePixels(image) == MagickFalse)
421
count=ReadBlob(image,length,pixels);
422
if (count != (ssize_t) length)
425
if (image->previous == (Image *) NULL)
427
status=SetImageProgress(image,LoadImageTag,2,5);
428
if (status == MagickFalse)
431
for (y=0; y < (long) image->extract_info.height; y++)
433
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
434
if (q == (PixelPacket *) NULL)
436
length=ImportQuantumPixels(canvas_image,quantum_info,BlueQuantum,
438
if (SyncImagePixels(canvas_image) == MagickFalse)
440
if (((y-image->extract_info.y) >= 0) &&
441
((y-image->extract_info.y) < (long) image->rows))
443
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
444
canvas_image->columns,1,exception);
445
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
447
if ((p == (const PixelPacket *) NULL) ||
448
(q == (PixelPacket *) NULL))
450
for (x=0; x < (long) image->columns; x++)
456
if (SyncImagePixels(image) == MagickFalse)
459
count=ReadBlob(image,length,pixels);
460
if (count != (ssize_t) length)
463
if (image->previous == (Image *) NULL)
465
status=SetImageProgress(image,LoadImageTag,3,5);
466
if (status == MagickFalse)
469
if (image->matte != MagickFalse)
471
for (y=0; y < (long) image->extract_info.height; y++)
473
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
474
if (q == (PixelPacket *) NULL)
476
length=ImportQuantumPixels(canvas_image,quantum_info,AlphaQuantum,
478
if (SyncImagePixels(canvas_image) == MagickFalse)
480
if (((y-image->extract_info.y) >= 0) &&
481
((y-image->extract_info.y) < (long) image->rows))
483
p=AcquireImagePixels(canvas_image,
484
canvas_image->extract_info.x,0,canvas_image->columns,1,
486
q=GetImagePixels(image,0,y-image->extract_info.y,
488
if ((p == (const PixelPacket *) NULL) ||
489
(q == (PixelPacket *) NULL))
491
for (x=0; x < (long) image->columns; x++)
493
q->opacity=p->opacity;
497
if (SyncImagePixels(image) == MagickFalse)
500
count=ReadBlob(image,length,pixels);
501
if (count != (ssize_t) length)
504
if (image->previous == (Image *) NULL)
506
status=SetImageProgress(image,LoadImageTag,4,5);
507
if (status == MagickFalse)
511
if (image->previous == (Image *) NULL)
513
status=SetImageProgress(image,LoadImageTag,5,5);
514
if (status == MagickFalse)
286
519
case PartitionInterlace:
292
Plane interlacing: YYYYYY...CbCbCbCbCbCb...CrCrCrCrCrCr...
522
Partition interlacing: YYYYYY..., CbCbCbCbCbCb..., CrCrCrCrCrCr...
294
if (image_info->interlace == PartitionInterlace)
296
AppendImageFormat("Y",image->filename);
297
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
298
if (status == MagickFalse)
300
image=DestroyImageList(image);
301
return((Image *) NULL);
304
packet_size=(size_t) ((image->depth+7)/8);
305
for (y=0; y < image->extract_info.y; y++)
306
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
308
span=image->rows*(image->matte != MagickFalse ? 5 : 4);
309
for (y=0; y < (long) image->rows; y++)
311
if ((y > 0) || (GetPreviousImageInList(image) == (Image *) NULL))
312
count=ReadBlob(image,packet_size*image->extract_info.width,
314
q=SetImagePixels(image,0,y,image->columns,1);
315
if (q == (PixelPacket *) NULL)
317
(void) ExportQuantumPixels(image,&quantum_info,RedQuantum,
319
if (SyncImagePixels(image) == MagickFalse)
321
if (image->previous == (Image *) NULL)
322
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
323
(QuantumTick(i,span) != MagickFalse))
325
status=image->progress_monitor(LoadImageTag,i,span,
327
if (status == MagickFalse)
332
width=image->extract_info.height-image->rows-image->extract_info.y;
333
for (i=0; i < (long) width; i++)
334
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
335
if (image_info->interlace == PartitionInterlace)
338
AppendImageFormat("Cb",image->filename);
339
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
340
if (status == MagickFalse)
342
image=DestroyImageList(image);
343
return((Image *) NULL);
346
for (y=0; y < image->extract_info.y; y++)
347
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
348
for (y=0; y < (long) image->rows; y++)
350
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
351
q=GetImagePixels(image,0,y,image->columns,1);
352
if (q == (PixelPacket *) NULL)
354
(void) ExportQuantumPixels(image,&quantum_info,GreenQuantum,
356
if (SyncImagePixels(image) == MagickFalse)
358
if (image->previous == (Image *) NULL)
359
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
360
(QuantumTick(i,span) != MagickFalse))
362
status=image->progress_monitor(LoadImageTag,i,span,
364
if (status == MagickFalse)
369
width=image->extract_info.height-image->rows-image->extract_info.y;
370
for (i=0; i < (long) width; i++)
371
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
372
if (image_info->interlace == PartitionInterlace)
375
AppendImageFormat("Cr",image->filename);
376
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
377
if (status == MagickFalse)
379
image=DestroyImageList(image);
380
return((Image *) NULL);
383
for (y=0; y < image->extract_info.y; y++)
384
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
385
for (y=0; y < (long) image->rows; y++)
387
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
388
q=GetImagePixels(image,0,y,image->columns,1);
389
if (q == (PixelPacket *) NULL)
391
(void) ExportQuantumPixels(image,&quantum_info,BlueQuantum,
393
if (SyncImagePixels(image) == MagickFalse)
395
if (image->previous == (Image *) NULL)
396
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
397
(QuantumTick(i,span) != MagickFalse))
399
status=image->progress_monitor(LoadImageTag,i,span,
401
if (status == MagickFalse)
406
width=image->extract_info.height-image->rows-image->extract_info.y;
407
for (i=0; i < (long) width; i++)
408
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
524
AppendImageFormat("Y",image->filename);
525
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
526
if (status == MagickFalse)
528
canvas_image=DestroyImageList(canvas_image);
529
image=DestroyImageList(image);
530
return((Image *) NULL);
532
for (i=0; i < image->offset; i++)
533
if (ReadBlobByte(image) == EOF)
535
ThrowFileException(exception,CorruptImageError,
536
"UnexpectedEndOfFile",image->filename);
539
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
540
for (i=0; i < (long) scene; i++)
541
for (y=0; y < (long) image->extract_info.height; y++)
542
if (ReadBlob(image,length,pixels) != (ssize_t) length)
544
ThrowFileException(exception,CorruptImageError,
545
"UnexpectedEndOfFile",image->filename);
548
count=ReadBlob(image,length,pixels);
549
if (count != (ssize_t) length)
551
for (y=0; y < (long) image->extract_info.height; y++)
553
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
554
if (q == (PixelPacket *) NULL)
556
length=ImportQuantumPixels(canvas_image,quantum_info,RedQuantum,
558
if (SyncImagePixels(canvas_image) == MagickFalse)
560
if (((y-image->extract_info.y) >= 0) &&
561
((y-image->extract_info.y) < (long) image->rows))
563
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
564
canvas_image->columns,1,exception);
565
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
567
if ((p == (const PixelPacket *) NULL) ||
568
(q == (PixelPacket *) NULL))
570
for (x=0; x < (long) image->columns; x++)
576
if (SyncImagePixels(image) == MagickFalse)
579
count=ReadBlob(image,length,pixels);
580
if (count != (ssize_t) length)
583
if (image->previous == (Image *) NULL)
585
status=SetImageProgress(image,LoadImageTag,1,5);
586
if (status == MagickFalse)
589
(void) CloseBlob(image);
590
AppendImageFormat("Cb",image->filename);
591
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
592
if (status == MagickFalse)
594
canvas_image=DestroyImageList(canvas_image);
595
image=DestroyImageList(image);
596
return((Image *) NULL);
598
length=GetQuantumExtent(canvas_image,quantum_info,GreenQuantum);
599
for (i=0; i < (long) scene; i++)
600
for (y=0; y < (long) image->extract_info.height; y++)
601
if (ReadBlob(image,length,pixels) != (ssize_t) length)
603
ThrowFileException(exception,CorruptImageError,
604
"UnexpectedEndOfFile",image->filename);
607
count=ReadBlob(image,length,pixels);
608
if (count != (ssize_t) length)
610
for (y=0; y < (long) image->extract_info.height; y++)
612
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
613
if (q == (PixelPacket *) NULL)
615
length=ImportQuantumPixels(canvas_image,quantum_info,GreenQuantum,
617
if (SyncImagePixels(canvas_image) == MagickFalse)
619
if (((y-image->extract_info.y) >= 0) &&
620
((y-image->extract_info.y) < (long) image->rows))
622
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
623
canvas_image->columns,1,exception);
624
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
626
if ((p == (const PixelPacket *) NULL) ||
627
(q == (PixelPacket *) NULL))
629
for (x=0; x < (long) image->columns; x++)
635
if (SyncImagePixels(image) == MagickFalse)
638
count=ReadBlob(image,length,pixels);
639
if (count != (ssize_t) length)
642
if (image->previous == (Image *) NULL)
644
status=SetImageProgress(image,LoadImageTag,2,5);
645
if (status == MagickFalse)
648
(void) CloseBlob(image);
649
AppendImageFormat("Cr",image->filename);
650
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
651
if (status == MagickFalse)
653
canvas_image=DestroyImageList(canvas_image);
654
image=DestroyImageList(image);
655
return((Image *) NULL);
657
length=GetQuantumExtent(canvas_image,quantum_info,BlueQuantum);
658
for (i=0; i < (long) scene; i++)
659
for (y=0; y < (long) image->extract_info.height; y++)
660
if (ReadBlob(image,length,pixels) != (ssize_t) length)
662
ThrowFileException(exception,CorruptImageError,
663
"UnexpectedEndOfFile",image->filename);
666
count=ReadBlob(image,length,pixels);
667
if (count != (ssize_t) length)
669
for (y=0; y < (long) image->extract_info.height; y++)
671
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
672
if (q == (PixelPacket *) NULL)
674
length=ImportQuantumPixels(canvas_image,quantum_info,BlueQuantum,
676
if (SyncImagePixels(canvas_image) == MagickFalse)
678
if (((y-image->extract_info.y) >= 0) &&
679
((y-image->extract_info.y) < (long) image->rows))
681
p=AcquireImagePixels(canvas_image,canvas_image->extract_info.x,0,
682
canvas_image->columns,1,exception);
683
q=GetImagePixels(image,0,y-image->extract_info.y,image->columns,
685
if ((p == (const PixelPacket *) NULL) ||
686
(q == (PixelPacket *) NULL))
688
for (x=0; x < (long) image->columns; x++)
694
if (SyncImagePixels(image) == MagickFalse)
697
count=ReadBlob(image,length,pixels);
698
if (count != (ssize_t) length)
701
if (image->previous == (Image *) NULL)
703
status=SetImageProgress(image,LoadImageTag,3,5);
704
if (status == MagickFalse)
409
707
if (image->matte != MagickFalse)
414
if (image_info->interlace == PartitionInterlace)
709
(void) CloseBlob(image);
710
AppendImageFormat("A",image->filename);
711
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
712
if (status == MagickFalse)
417
AppendImageFormat("A",image->filename);
418
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
419
if (status == MagickFalse)
714
canvas_image=DestroyImageList(canvas_image);
715
image=DestroyImageList(image);
716
return((Image *) NULL);
718
length=GetQuantumExtent(canvas_image,quantum_info,AlphaQuantum);
719
for (i=0; i < (long) scene; i++)
720
for (y=0; y < (long) image->extract_info.height; y++)
721
if (ReadBlob(image,length,pixels) != (ssize_t) length)
421
image=DestroyImageList(image);
422
return((Image *) NULL);
723
ThrowFileException(exception,CorruptImageError,
724
"UnexpectedEndOfFile",image->filename);
425
for (y=0; y < image->extract_info.y; y++)
426
count=ReadBlob(image,packet_size*image->extract_info.width,
428
for (y=0; y < (long) image->rows; y++)
727
count=ReadBlob(image,length,pixels);
728
if (count != (ssize_t) length)
730
for (y=0; y < (long) image->extract_info.height; y++)
430
count=ReadBlob(image,packet_size*image->extract_info.width,
432
q=GetImagePixels(image,0,y,image->columns,1);
732
q=GetImagePixels(canvas_image,0,0,canvas_image->columns,1);
433
733
if (q == (PixelPacket *) NULL)
435
(void) ExportQuantumPixels(image,&quantum_info,AlphaQuantum,
437
if (SyncImagePixels(image) == MagickFalse)
735
length=ImportQuantumPixels(canvas_image,quantum_info,BlueQuantum,
737
if (SyncImagePixels(canvas_image) == MagickFalse)
439
if (image->previous == (Image *) NULL)
440
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
441
(QuantumTick(i,span) != MagickFalse))
739
if (((y-image->extract_info.y) >= 0) &&
740
((y-image->extract_info.y) < (long) image->rows))
742
p=AcquireImagePixels(canvas_image,
743
canvas_image->extract_info.x,0,canvas_image->columns,1,
745
q=GetImagePixels(image,0,y-image->extract_info.y,
747
if ((p == (const PixelPacket *) NULL) ||
748
(q == (PixelPacket *) NULL))
750
for (x=0; x < (long) image->columns; x++)
443
status=image->progress_monitor(LoadImageTag,i,span,
445
if (status == MagickFalse)
752
q->opacity=p->opacity;
756
if (SyncImagePixels(image) == MagickFalse)
759
count=ReadBlob(image,length,pixels);
760
if (count != (ssize_t) length)
450
width=image->extract_info.height-image->rows-image->extract_info.y;
451
for (i=0; i < (long) width; i++)
452
count=ReadBlob(image,packet_size*image->extract_info.width,
455
if (image_info->interlace == PartitionInterlace)
456
(void) CopyMagickString(image->filename,image_info->filename,
763
if (image->previous == (Image *) NULL)
765
status=SetImageProgress(image,LoadImageTag,4,5);
766
if (status == MagickFalse)
770
if (image->previous == (Image *) NULL)
772
status=SetImageProgress(image,LoadImageTag,5,5);
773
if (status == MagickFalse)
461
if (EOFBlob(image) != MagickFalse)
463
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
779
SetQuantumImageType(image,quantum_type);
468
781
Proceed to next image.
470
783
if (image_info->number_scenes != 0)
471
784
if (image->scene >= (image_info->scene+image_info->number_scenes-1))
473
if (image_info->interlace == PartitionInterlace)
475
count=ReadBlob(image,packet_size*image->extract_info.width,pixels);
786
if (count == (ssize_t) length)
479
789
Allocate next image structure.
481
AllocateNextImage(image_info,image);
791
AcquireNextImage(image_info,image);
482
792
if (GetNextImageInList(image) == (Image *) NULL)
484
794
image=DestroyImageList(image);
485
795
return((Image *) NULL);
487
797
image=SyncNextImageInList(image);
488
if (image->progress_monitor != (MagickProgressMonitor) NULL)
490
status=image->progress_monitor(LoadImagesTag,TellBlob(image),
491
GetBlobSize(image),image->client_data);
492
if (status == MagickFalse)
798
status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
800
if (status == MagickFalse)
496
} while (count != 0);
497
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
804
} while (count == (ssize_t) length);
805
InheritException(exception,&image->exception);
806
quantum_info=DestroyQuantumInfo(quantum_info);
807
canvas_image=DestroyImage(canvas_image);
808
(void) CloseBlob(image);
499
809
return(GetFirstImageInList(image));
730
1042
case PlaneInterlace:
731
case PartitionInterlace:
734
1045
Plane interlacing: YYYYYY...CbCbCbCbCbCb...CrCrCrCrCrCr...
736
packet_size=(image->depth+7)/8;
737
if (image_info->interlace == PartitionInterlace)
739
AppendImageFormat("Y",image->filename);
741
OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
742
if (status == MagickFalse)
745
for (y=0; y < (long) image->rows; y++)
747
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
748
if (p == (const PixelPacket *) NULL)
750
(void) ImportQuantumPixels(image,&quantum_info,RedQuantum,pixels);
751
(void) WriteBlob(image,packet_size*image->columns,pixels);
753
if (image_info->interlace == PartitionInterlace)
756
AppendImageFormat("Cb",image->filename);
757
status=OpenBlob(image_info,image,WriteBinaryBlobMode,
759
if (status == MagickFalse)
762
if (image->progress_monitor != (MagickProgressMonitor) NULL)
764
status=image->progress_monitor(LoadImageTag,100,400,
766
if (status == MagickFalse)
769
for (y=0; y < (long) image->rows; y++)
771
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
772
if (p == (const PixelPacket *) NULL)
774
(void) ImportQuantumPixels(image,&quantum_info,GreenQuantum,pixels);
775
(void) WriteBlob(image,packet_size*image->columns,pixels);
777
if (image_info->interlace == PartitionInterlace)
780
AppendImageFormat("Cr",image->filename);
781
status=OpenBlob(image_info,image,WriteBinaryBlobMode,
783
if (status == MagickFalse)
786
if (image->progress_monitor != (MagickProgressMonitor) NULL)
788
status=image->progress_monitor(LoadImageTag,200,400,
790
if (status == MagickFalse)
793
for (y=0; y < (long) image->rows; y++)
795
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
796
if (p == (const PixelPacket *) NULL)
798
(void) ImportQuantumPixels(image,&quantum_info,BlueQuantum,pixels);
799
(void) WriteBlob(image,packet_size*image->columns,pixels);
801
if (LocaleCompare(image_info->magick,"YCbCrA") == 0)
803
if (image->progress_monitor != (MagickProgressMonitor) NULL)
805
status=image->progress_monitor(LoadImageTag,300,400,
807
if (status == MagickFalse)
810
if (image_info->interlace == PartitionInterlace)
813
AppendImageFormat("A",image->filename);
814
status=OpenBlob(image_info,image,WriteBinaryBlobMode,
816
if (status == MagickFalse)
1047
for (y=0; y < (long) image->rows; y++)
1049
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1050
if (p == (const PixelPacket *) NULL)
1052
length=ExportQuantumPixels(image,quantum_info,RedQuantum,pixels);
1053
count=WriteBlob(image,length,pixels);
1054
if (count != (ssize_t) length)
1057
if (image->previous == (Image *) NULL)
1059
status=SetImageProgress(image,SaveImageTag,1,5);
1060
if (status == MagickFalse)
1063
for (y=0; y < (long) image->rows; y++)
1065
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1066
if (p == (const PixelPacket *) NULL)
1068
length=ExportQuantumPixels(image,quantum_info,GreenQuantum,pixels);
1069
count=WriteBlob(image,length,pixels);
1070
if (count != (ssize_t) length)
1073
if (image->previous == (Image *) NULL)
1075
status=SetImageProgress(image,SaveImageTag,2,5);
1076
if (status == MagickFalse)
1079
for (y=0; y < (long) image->rows; y++)
1081
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1082
if (p == (const PixelPacket *) NULL)
1084
length=ExportQuantumPixels(image,quantum_info,BlueQuantum,pixels);
1085
count=WriteBlob(image,length,pixels);
1086
if (count != (ssize_t) length)
1089
if (image->previous == (Image *) NULL)
1091
status=SetImageProgress(image,SaveImageTag,3,5);
1092
if (status == MagickFalse)
1095
if (quantum_type == RGBAQuantum)
819
1097
for (y=0; y < (long) image->rows; y++)
821
1099
p=AcquireImagePixels(image,0,y,image->columns,1,
822
1100
&image->exception);
823
1101
if (p == (const PixelPacket *) NULL)
825
(void) ImportQuantumPixels(image,&quantum_info,AlphaQuantum,
1103
length=ExportQuantumPixels(image,quantum_info,AlphaQuantum,
827
(void) WriteBlob(image,packet_size*image->columns,pixels);
1105
count=WriteBlob(image,length,pixels);
1106
if (count != (ssize_t) length)
830
1110
if (image_info->interlace == PartitionInterlace)
831
1111
(void) CopyMagickString(image->filename,image_info->filename,
833
if (image->progress_monitor != (MagickProgressMonitor) NULL)
835
status=image->progress_monitor(LoadImageTag,400,400,
1113
if (image->previous == (Image *) NULL)
1115
status=SetImageProgress(image,SaveImageTag,5,5);
1116
if (status == MagickFalse)
1121
case PartitionInterlace:
1124
Partition interlacing: YYYYYY..., CbCbCbCbCbCb..., CrCrCrCrCrCr...
1126
AppendImageFormat("Y",image->filename);
1127
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
1128
AppendBinaryBlobMode,&image->exception);
1129
if (status == MagickFalse)
1131
for (y=0; y < (long) image->rows; y++)
1133
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1134
if (p == (const PixelPacket *) NULL)
1136
length=ExportQuantumPixels(image,quantum_info,RedQuantum,pixels);
1137
count=WriteBlob(image,length,pixels);
1138
if (count != (ssize_t) length)
1141
if (image->previous == (Image *) NULL)
1143
status=SetImageProgress(image,SaveImageTag,1,5);
1144
if (status == MagickFalse)
1147
(void) CloseBlob(image);
1148
AppendImageFormat("Cb",image->filename);
1149
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
1150
AppendBinaryBlobMode,&image->exception);
1151
if (status == MagickFalse)
1153
for (y=0; y < (long) image->rows; y++)
1155
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1156
if (p == (const PixelPacket *) NULL)
1158
length=ExportQuantumPixels(image,quantum_info,GreenQuantum,pixels);
1159
count=WriteBlob(image,length,pixels);
1160
if (count != (ssize_t) length)
1163
if (image->previous == (Image *) NULL)
1165
status=SetImageProgress(image,SaveImageTag,2,5);
1166
if (status == MagickFalse)
1169
(void) CloseBlob(image);
1170
AppendImageFormat("Cr",image->filename);
1171
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
1172
AppendBinaryBlobMode,&image->exception);
1173
if (status == MagickFalse)
1175
for (y=0; y < (long) image->rows; y++)
1177
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1178
if (p == (const PixelPacket *) NULL)
1180
length=ExportQuantumPixels(image,quantum_info,BlueQuantum,pixels);
1181
count=WriteBlob(image,length,pixels);
1182
if (count != (ssize_t) length)
1185
if (image->previous == (Image *) NULL)
1187
status=SetImageProgress(image,SaveImageTag,3,5);
1188
if (status == MagickFalse)
1191
if (quantum_type == RGBAQuantum)
1193
(void) CloseBlob(image);
1194
AppendImageFormat("A",image->filename);
1195
status=OpenBlob(image_info,image,scene == 0 ? WriteBinaryBlobMode :
1196
AppendBinaryBlobMode,&image->exception);
1197
if (status == MagickFalse)
1199
for (y=0; y < (long) image->rows; y++)
1201
p=AcquireImagePixels(image,0,y,image->columns,1,
1203
if (p == (const PixelPacket *) NULL)
1205
length=ExportQuantumPixels(image,quantum_info,AlphaQuantum,
1207
count=WriteBlob(image,length,pixels);
1208
if (count != (ssize_t) length)
1211
if (image->previous == (Image *) NULL)
1213
status=SetImageProgress(image,SaveImageTag,4,5);
1214
if (status == MagickFalse)
1218
(void) CloseBlob(image);
1219
(void) CopyMagickString(image->filename,image_info->filename,
1221
if (image->previous == (Image *) NULL)
1223
status=SetImageProgress(image,SaveImageTag,5,5);
837
1224
if (status == MagickFalse)
1230
quantum_info=DestroyQuantumInfo(quantum_info);
843
1231
if (GetNextImageInList(image) == (Image *) NULL)
845
1233
image=SyncNextImageInList(image);
846
if (image->progress_monitor != (MagickProgressMonitor) NULL)
848
status=image->progress_monitor(SaveImagesTag,scene,
849
GetImageListLength(image),image->client_data);
850
if (status == MagickFalse)
1234
status=SetImageProgress(image,SaveImagesTag,scene++,
1235
GetImageListLength(image));
1236
if (status == MagickFalse)
854
1238
} while (image_info->adjoin != MagickFalse);
855
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
1239
(void) CloseBlob(image);
857
1240
return(MagickTrue);