617
615
offset+=ReadBlob(image,sizeof(dpx.file.version),(unsigned char *)
618
616
dpx.file.version);
619
(void) SetImageProperty(image,"dpx:file.version",dpx.file.version);
617
(void) FormatImageProperty(image,"dpx:file.version","%.8s",dpx.file.version);
620
618
dpx.file.file_size=ReadBlobLong(image);
622
620
dpx.file.ditto_key=ReadBlobLong(image);
624
if (dpx.file.ditto_key != ~0UL)
625
(void) FormatImageProperty(image,"dpx:file.ditto.key","%lu",
622
if (dpx.file.ditto_key != ~0U)
623
(void) FormatImageProperty(image,"dpx:file.ditto.key","%u",
626
624
dpx.file.ditto_key);
627
625
dpx.file.generic_size=ReadBlobLong(image);
633
631
offset+=ReadBlob(image,sizeof(dpx.file.filename),(unsigned char *)
634
632
dpx.file.filename);
635
(void) SetImageProperty(image,"dpx:file.filename",dpx.file.filename);
636
if (*dpx.file.filename != '\0')
638
(void) FormatImageProperty(image,"dpx:file.filename","%.100s",
640
(void) FormatImageProperty(image,"document","%.100s",dpx.file.filename);
633
(void) FormatImageProperty(image,"dpx:file.filename","%.100s",
635
(void) FormatImageProperty(image,"document","%.100s",dpx.file.filename);
642
636
offset+=ReadBlob(image,sizeof(dpx.file.timestamp),(unsigned char *)
643
637
dpx.file.timestamp);
644
638
if (*dpx.file.timestamp != '\0')
743
737
dpx.image.reserve);
744
738
component_type=dpx.image.image_element[0].descriptor;
745
739
image->depth=dpx.image.image_element[0].bit_size;
746
if (dpx.file.image_offset >= 1664UL)
740
if (dpx.file.image_offset >= 1664U)
749
743
Read DPX orientation header.
751
745
dpx.orientation.x_offset=ReadBlobLong(image);
753
if (dpx.orientation.x_offset != ~0UL)
754
(void) FormatImageProperty(image,"dpx:orientation.x_offset","%lu",
747
if (dpx.orientation.x_offset != ~0U)
748
(void) FormatImageProperty(image,"dpx:orientation.x_offset","%u",
755
749
dpx.orientation.x_offset);
756
750
dpx.orientation.y_offset=ReadBlobLong(image);
758
if (dpx.orientation.y_offset != ~0UL)
759
(void) FormatImageProperty(image,"dpx:orientation.y_offset","%lu",
752
if (dpx.orientation.y_offset != ~0U)
753
(void) FormatImageProperty(image,"dpx:orientation.y_offset","%u",
760
754
dpx.orientation.y_offset);
761
755
dpx.orientation.x_center=ReadBlobFloat(image);
770
764
dpx.orientation.y_center);
771
765
dpx.orientation.x_size=ReadBlobLong(image);
773
if (dpx.orientation.x_size != ~0UL)
774
(void) FormatImageProperty(image,"dpx:orientation.x_size","%lu",
767
if (dpx.orientation.x_size != ~0U)
768
(void) FormatImageProperty(image,"dpx:orientation.x_size","%u",
775
769
dpx.orientation.x_size);
776
770
dpx.orientation.y_size=ReadBlobLong(image);
778
if (dpx.orientation.y_size != ~0UL)
779
(void) FormatImageProperty(image,"dpx:orientation.y_size","%lu",
772
if (dpx.orientation.y_size != ~0U)
773
(void) FormatImageProperty(image,"dpx:orientation.y_size","%u",
780
774
dpx.orientation.y_size);
781
775
offset+=ReadBlob(image,sizeof(dpx.orientation.filename),(unsigned char *)
782
776
dpx.orientation.filename);
812
806
dpx.orientation.aspect_ratio[i]=ReadBlobLong(image);
815
if ((dpx.orientation.aspect_ratio[0] != ~0UL) &&
816
(dpx.orientation.aspect_ratio[1] != ~0UL))
809
if ((dpx.orientation.aspect_ratio[0] != ~0U) &&
810
(dpx.orientation.aspect_ratio[1] != ~0U))
817
811
(void) FormatImageProperty(image,"dpx:orientation.aspect_ratio",
818
"%lux%lu",dpx.orientation.aspect_ratio[0],
812
"%ux%u",dpx.orientation.aspect_ratio[0],
819
813
dpx.orientation.aspect_ratio[1]);
820
814
offset+=ReadBlob(image,sizeof(dpx.orientation.reserve),(unsigned char *)
821
815
dpx.orientation.reserve);
823
if (dpx.file.image_offset >= 1920UL)
817
if (dpx.file.image_offset >= 1920U)
826
820
Read DPX film header.
854
848
dpx.film.format);
855
849
dpx.film.frame_position=ReadBlobLong(image);
857
if (dpx.film.frame_position != ~0UL)
858
(void) FormatImageProperty(image,"dpx:file.frame_position","%lu",
851
if (dpx.film.frame_position != ~0U)
852
(void) FormatImageProperty(image,"dpx:film.frame_position","%u",
859
853
dpx.film.frame_position);
860
dpx.film.sequence_length=ReadBlobLong(image);
854
dpx.film.sequence_extent=ReadBlobLong(image);
862
if (dpx.film.sequence_length != ~0UL)
863
(void) FormatImageProperty(image,"dpx:file.sequence_length","%lu",
864
dpx.film.sequence_length);
856
if (dpx.film.sequence_extent != ~0U)
857
(void) FormatImageProperty(image,"dpx:film.sequence_extent","%u",
858
dpx.film.sequence_extent);
865
859
dpx.film.held_count=ReadBlobLong(image);
867
if (dpx.film.held_count != ~0UL)
868
(void) FormatImageProperty(image,"dpx:file.held_count","%lu",
861
if (dpx.film.held_count != ~0U)
862
(void) FormatImageProperty(image,"dpx:film.held_count","%u",
869
863
dpx.film.held_count);
870
864
dpx.film.frame_rate=ReadBlobFloat(image);
1065
1053
image->colorspace=RGBColorspace;
1054
if (dpx.image.image_element[0].transfer == LogarithmicColorimetric)
1055
image->colorspace=LogColorspace;
1066
1056
if (dpx.image.image_element[0].transfer == PrintingDensityColorimetric)
1067
1057
image->colorspace=LogColorspace;
1071
if (image->colorspace != UndefinedColorspace)
1072
image->colorspace=image->colorspace;
1073
length=GetBytesPerRow(image->columns,samples_per_pixel,image->depth,
1061
extent=GetBytesPerRow(image->columns,samples_per_pixel,image->depth,
1074
1062
dpx.image.image_element[0].packing == 0 ? MagickFalse : MagickTrue);
1075
pixels=GetQuantumPixels(quantum_info);
1076
if ((quantum_type == GrayQuantum) && (quantum_info->pack == MagickFalse) &&
1077
(image->depth == 10) && (image->endian == MSBEndian))
1063
if ((quantum_type == GrayQuantum) &&
1064
(dpx.image.image_element[0].packing != 0) && (image->depth == 10) &&
1065
(image->endian == MSBEndian))
1082
quantum_info=AcquireQuantumInfo(image_info,image);
1083
if (quantum_info == (QuantumInfo *) NULL)
1084
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
1085
SetQuantumQuantum(quantum_info,32);
1086
SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ?
1087
MagickTrue : MagickFalse);
1088
pixels=GetQuantumPixels(quantum_info);
1090
scale=GetQuantumScale(image->depth);
1091
range=GetQuantumRange(image->depth);
1091
1092
for (y=0; y < (long) image->rows; y++)
1093
q=SetImagePixels(image,0,y,image->columns,1);
1094
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
1094
1095
if (q == (PixelPacket *) NULL)
1096
1097
for (x=0; x < (long) image->columns; x++)
1120
1119
q->blue=q->red;
1123
if (SyncImagePixels(image) == MagickFalse)
1122
if (SyncAuthenticPixels(image,exception) == MagickFalse)
1125
1124
status=SetImageProgress(image,LoadImageTag,y,image->rows);
1126
1125
if (status == MagickFalse)
1128
quantum_info=DestroyQuantumInfo(quantum_info);
1131
for (y=0; y < (long) image->rows; y++)
1134
1142
DPX any-bit pixel format.
1136
q=SetImagePixels(image,0,y,image->columns,1);
1137
if (q == (PixelPacket *) NULL)
1139
count=ReadBlob(image,length,pixels);
1140
if ((size_t) count != length)
1142
(void) ImportQuantumPixels(image,quantum_info,quantum_type,pixels);
1143
if (SyncImagePixels(image) == MagickFalse)
1145
status=SetImageProgress(image,LoadImageTag,y,image->rows);
1146
quantum_info=AcquireQuantumInfo(image_info,image);
1147
if (quantum_info == (QuantumInfo *) NULL)
1148
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
1149
SetQuantumQuantum(quantum_info,32);
1150
SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ?
1151
MagickTrue : MagickFalse);
1152
image_view=AcquireCacheView(image);
1153
#if defined(MAGICKCORE_OPENMP_SUPPORT)
1154
#pragma omp parallel for schedule(dynamic,1) shared(row,status,quantum_type)
1156
for (y=0; y < (long) image->rows; y++)
1164
register PixelPacket
1176
if (status == MagickFalse)
1178
pixels=GetQuantumPixels(quantum_info);
1179
#if defined(MAGICKCORE_OPENMP_SUPPORT)
1180
#pragma omp critical (MagickCore_ReadDPXImage)
1183
count=ReadBlob(image,extent,pixels);
1184
if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
1185
(image->previous == (Image *) NULL))
1190
proceed=SetImageProgress(image,LoadImageTag,row,image->rows);
1191
if (proceed == MagickFalse)
1196
if (count != (ssize_t) extent)
1198
q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,
1200
if (q == (PixelPacket *) NULL)
1205
length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type,
1207
sync=SyncCacheViewAuthenticPixels(image_view,exception);
1208
if (sync == MagickFalse)
1211
image_view=DestroyCacheView(image_view);
1212
quantum_info=DestroyQuantumInfo(quantum_info);
1146
1213
if (status == MagickFalse)
1214
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
1149
1216
SetQuantumImageType(image,quantum_type);
1150
quantum_info=DestroyQuantumInfo(quantum_info);
1151
1217
if (EOFBlob(image) != MagickFalse)
1152
1218
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
1153
1219
image->filename);
1359
1425
(void) ResetMagickMemory(&dpx,0,sizeof(dpx));
1361
dpx.file.magic=0x53445058UL;
1427
dpx.file.magic=0x53445058U;
1362
1428
offset+=WriteBlobLong(image,dpx.file.magic);
1363
dpx.file.image_offset=0x2000UL;
1429
dpx.file.image_offset=0x2000U;
1364
1430
profile=GetImageProfile(image,"dpx:user.data");
1365
1431
if (profile != (StringInfo *) NULL)
1367
dpx.file.image_offset+=(unsigned long) GetStringInfoLength(profile);
1433
dpx.file.image_offset+=(unsigned int) GetStringInfoLength(profile);
1368
1434
dpx.file.image_offset=(((dpx.file.image_offset+0x2000-1)/0x2000)*0x2000);
1370
1436
offset+=WriteBlobLong(image,dpx.file.image_offset);
1371
(void) CopyMagickString(dpx.file.version,"V2.0",MaxTextExtent);
1437
(void) strncpy(dpx.file.version,"V2.0",sizeof(dpx.file.version));
1372
1438
offset+=WriteBlob(image,8,(unsigned char *) &dpx.file.version);
1373
dpx.file.file_size=4UL*image->columns*image->rows+dpx.file.image_offset;
1439
dpx.file.file_size=(unsigned int) (4U*image->columns*image->rows+
1440
dpx.file.image_offset);
1374
1441
offset+=WriteBlobLong(image,dpx.file.file_size);
1375
dpx.file.ditto_key=1UL; /* new frame */
1442
dpx.file.ditto_key=1U; /* new frame */
1376
1443
offset+=WriteBlobLong(image,dpx.file.ditto_key);
1377
dpx.file.generic_size=0x00000680UL;
1444
dpx.file.generic_size=0x00000680U;
1378
1445
offset+=WriteBlobLong(image,dpx.file.generic_size);
1379
dpx.file.industry_size=0x00000180UL;
1446
dpx.file.industry_size=0x00000180U;
1380
1447
offset+=WriteBlobLong(image,dpx.file.industry_size);
1381
1448
dpx.file.user_size=0;
1382
1449
if (profile != (StringInfo *) NULL)
1384
dpx.file.user_size+=(unsigned long) GetStringInfoLength(profile);
1451
dpx.file.user_size+=(unsigned int) GetStringInfoLength(profile);
1385
1452
dpx.file.user_size=(((dpx.file.user_size+0x2000-1)/0x2000)*0x2000);
1387
1454
offset+=WriteBlobLong(image,dpx.file.user_size);
1388
(void) CopyMagickString(dpx.file.filename,"V2.0",sizeof(dpx.file.filename));
1389
1455
value=GetDPXProperty(image_info,image,"dpx:file.filename");
1390
1456
if (value != (const char *) NULL)
1391
(void) CopyMagickString(dpx.file.filename,value,sizeof(dpx.file.filename));
1457
(void) strncpy(dpx.file.filename,value,sizeof(dpx.file.filename));
1392
1458
offset+=WriteBlob(image,sizeof(dpx.file.filename),(unsigned char *)
1393
1459
dpx.file.filename);
1394
1460
seconds=time((time_t *) NULL);
1396
1462
dpx.file.timestamp);
1397
1463
offset+=WriteBlob(image,sizeof(dpx.file.timestamp),(unsigned char *)
1398
1464
dpx.file.timestamp);
1399
(void) CopyMagickString(dpx.file.creator,GetMagickVersion((unsigned long *)
1400
NULL),sizeof(dpx.file.creator));
1465
(void) strncpy(dpx.file.creator,GetMagickVersion((unsigned long *) NULL),
1466
sizeof(dpx.file.creator));
1401
1467
value=GetDPXProperty(image_info,image,"dpx:file.creator");
1402
1468
if (value != (const char *) NULL)
1403
(void) CopyMagickString(dpx.file.creator,value,sizeof(dpx.file.creator));
1469
(void) strncpy(dpx.file.creator,value,sizeof(dpx.file.creator));
1404
1470
offset+=WriteBlob(image,sizeof(dpx.file.creator),(unsigned char *)
1405
1471
dpx.file.creator);
1406
1472
value=GetDPXProperty(image_info,image,"dpx:file.project");
1407
1473
if (value != (const char *) NULL)
1408
(void) CopyMagickString(dpx.file.project,value,sizeof(dpx.file.project));
1474
(void) strncpy(dpx.file.project,value,sizeof(dpx.file.project));
1409
1475
offset+=WriteBlob(image,sizeof(dpx.file.project),(unsigned char *)
1410
1476
dpx.file.project);
1411
1477
value=GetDPXProperty(image_info,image,"dpx:file.copyright");
1412
1478
if (value != (const char *) NULL)
1413
(void) CopyMagickString(dpx.file.copyright,value,
1479
(void) strncpy(dpx.file.copyright,value,
1414
1480
sizeof(dpx.file.copyright));
1415
1481
offset+=WriteBlob(image,sizeof(dpx.file.copyright),(unsigned char *)
1416
1482
dpx.file.copyright);
1417
dpx.file.encrypt_key=(~0UL);
1483
dpx.file.encrypt_key=(~0U);
1418
1484
offset+=WriteBlobLong(image,dpx.file.encrypt_key);
1419
1485
offset+=WriteBlob(image,sizeof(dpx.file.reserve),(unsigned char *)
1420
1486
dpx.file.reserve);
1425
1491
offset+=WriteBlobShort(image,dpx.image.orientation);
1426
1492
dpx.image.number_elements=1;
1427
1493
offset+=WriteBlobShort(image,dpx.image.number_elements);
1428
offset+=WriteBlobLong(image,image->columns);
1429
offset+=WriteBlobLong(image,image->rows);
1494
offset+=WriteBlobLong(image,(unsigned int) image->columns);
1495
offset+=WriteBlobLong(image,(unsigned int) image->rows);
1430
1496
for (i=0; i < 8; i++)
1432
dpx.image.image_element[i].data_sign=0UL;
1498
dpx.image.image_element[i].data_sign=0U;
1433
1499
offset+=WriteBlobLong(image,dpx.image.image_element[i].data_sign);
1434
dpx.image.image_element[i].low_data=0UL;
1500
dpx.image.image_element[i].low_data=0U;
1435
1501
offset+=WriteBlobLong(image,dpx.image.image_element[i].low_data);
1436
1502
dpx.image.image_element[i].low_quantity=0.0f;
1437
1503
offset+=WriteBlobFloat(image,dpx.image.image_element[i].low_quantity);
1438
dpx.image.image_element[i].high_data=0UL;
1504
dpx.image.image_element[i].high_data=0U;
1439
1505
offset+=WriteBlobLong(image,dpx.image.image_element[i].high_data);
1440
1506
dpx.image.image_element[i].high_quantity=0.0f;
1441
1507
offset+=WriteBlobFloat(image,dpx.image.image_element[i].high_quantity);
1459
1525
offset+=WriteBlobShort(image,dpx.image.image_element[i].packing);
1460
1526
dpx.image.image_element[i].encoding=0;
1461
1527
offset+=WriteBlobShort(image,dpx.image.image_element[i].encoding);
1462
dpx.image.image_element[i].data_offset=0UL;
1528
dpx.image.image_element[i].data_offset=0U;
1464
1530
dpx.image.image_element[i].data_offset=dpx.file.image_offset;
1465
1531
offset+=WriteBlobLong(image,dpx.image.image_element[i].data_offset);
1466
dpx.image.image_element[i].end_of_line_padding=0UL;
1532
dpx.image.image_element[i].end_of_line_padding=0U;
1467
1533
offset+=WriteBlobLong(image,dpx.image.image_element[i].end_of_line_padding);
1468
1534
offset+=WriteBlobLong(image,
1469
1535
dpx.image.image_element[i].end_of_image_padding);
1488
1554
(void) DeleteImageProperty(image,"dpx:orientation.x_size");
1489
1555
(void) DeleteImageProperty(image,"dpx:orientation.y_size");
1491
dpx.orientation.x_offset=0UL;
1557
dpx.orientation.x_offset=0U;
1492
1558
value=GetDPXProperty(image_info,image,"dpx:orientation.x_offset");
1493
1559
if (value != (const char *) NULL)
1494
dpx.orientation.x_offset=(unsigned long) atol(value);
1560
dpx.orientation.x_offset=(unsigned int) atoi(value);
1495
1561
offset+=WriteBlobLong(image,dpx.orientation.x_offset);
1496
dpx.orientation.y_offset=0UL;
1562
dpx.orientation.y_offset=0U;
1497
1563
value=GetDPXProperty(image_info,image,"dpx:orientation.y_offset");
1498
1564
if (value != (const char *) NULL)
1499
dpx.orientation.y_offset=(unsigned long) atol(value);
1565
dpx.orientation.y_offset=(unsigned int) atoi(value);
1500
1566
offset+=WriteBlobLong(image,dpx.orientation.y_offset);
1501
1567
dpx.orientation.x_center=0.0f;
1502
1568
value=GetDPXProperty(image_info,image,"dpx:orientation.x_center");
1508
1574
if (value != (const char *) NULL)
1509
1575
dpx.orientation.y_center=atof(value);
1510
1576
offset+=WriteBlobFloat(image,dpx.orientation.y_center);
1511
dpx.orientation.x_size=0UL;
1577
dpx.orientation.x_size=0U;
1512
1578
value=GetDPXProperty(image_info,image,"dpx:orientation.x_size");
1513
1579
if (value != (const char *) NULL)
1514
dpx.orientation.x_size=(unsigned long) atol(value);
1580
dpx.orientation.x_size=(unsigned int) atoi(value);
1515
1581
offset+=WriteBlobLong(image,dpx.orientation.x_size);
1516
dpx.orientation.y_size=0UL;
1582
dpx.orientation.y_size=0U;
1517
1583
value=GetDPXProperty(image_info,image,"dpx:orientation.y_size");
1518
1584
if (value != (const char *) NULL)
1519
dpx.orientation.y_size=(unsigned long) atol(value);
1585
dpx.orientation.y_size=(unsigned int) atoi(value);
1520
1586
offset+=WriteBlobLong(image,dpx.orientation.y_size);
1521
1587
value=GetDPXProperty(image_info,image,"dpx:orientation.filename");
1522
1588
if (value != (const char *) NULL)
1523
(void) CopyMagickString(dpx.orientation.filename,value,
1589
(void) strncpy(dpx.orientation.filename,value,
1524
1590
sizeof(dpx.orientation.filename));
1525
1591
offset+=WriteBlob(image,sizeof(dpx.orientation.filename),(unsigned char *)
1526
1592
dpx.orientation.filename);
1550
1616
for (i=0; i < 4; i++)
1551
1617
offset+=WriteBlobShort(image,dpx.orientation.border[i]);
1552
1618
for (i=0; i < 2; i++)
1553
dpx.orientation.aspect_ratio[i]=0UL;
1619
dpx.orientation.aspect_ratio[i]=0U;
1554
1620
value=GetDPXProperty(image_info,image,"dpx:orientation.aspect_ratio");
1555
1621
if (value != (const char *) NULL)
1557
1623
flags=ParseGeometry(value,&geometry_info);
1558
1624
if ((flags & SigmaValue) == 0)
1559
1625
geometry_info.sigma=geometry_info.rho;
1560
dpx.orientation.aspect_ratio[0]=(unsigned long) (geometry_info.rho+0.5);
1561
dpx.orientation.aspect_ratio[1]=(unsigned long) (geometry_info.sigma+0.5);
1626
dpx.orientation.aspect_ratio[0]=(unsigned int) (geometry_info.rho+0.5);
1627
dpx.orientation.aspect_ratio[1]=(unsigned int) (geometry_info.sigma+0.5);
1563
1629
for (i=0; i < 2; i++)
1564
1630
offset+=WriteBlobLong(image,dpx.orientation.aspect_ratio[i]);
1570
1636
*dpx.film.id='\0';
1571
1637
value=GetDPXProperty(image_info,image,"dpx:film.id");
1572
1638
if (value != (const char *) NULL)
1573
(void) CopyMagickString(dpx.film.id,value,sizeof(dpx.film.id));
1639
(void) strncpy(dpx.film.id,value,sizeof(dpx.film.id));
1574
1640
offset+=WriteBlob(image,sizeof(dpx.film.id),(unsigned char *) dpx.film.id);
1575
1641
*dpx.film.type='\0';
1576
1642
value=GetDPXProperty(image_info,image,"dpx:film.type");
1577
1643
if (value != (const char *) NULL)
1578
(void) CopyMagickString(dpx.film.type,value,sizeof(dpx.film.type));
1579
offset+=WriteBlob(image,sizeof(dpx.film.type),(unsigned char *) dpx.film.type);
1644
(void) strncpy(dpx.film.type,value,sizeof(dpx.film.type));
1645
offset+=WriteBlob(image,sizeof(dpx.film.type),(unsigned char *)
1580
1647
*dpx.film.offset='\0';
1581
1648
value=GetDPXProperty(image_info,image,"dpx:film.offset");
1582
1649
if (value != (const char *) NULL)
1583
(void) CopyMagickString(dpx.film.offset,value,sizeof(dpx.film.offset));
1650
(void) strncpy(dpx.film.offset,value,sizeof(dpx.film.offset));
1584
1651
offset+=WriteBlob(image,sizeof(dpx.film.offset),(unsigned char *)
1585
1652
dpx.film.offset);
1586
1653
*dpx.film.prefix='\0';
1587
1654
value=GetDPXProperty(image_info,image,"dpx:film.prefix");
1588
1655
if (value != (const char *) NULL)
1589
(void) CopyMagickString(dpx.film.prefix,value,sizeof(dpx.film.prefix));
1656
(void) strncpy(dpx.film.prefix,value,sizeof(dpx.film.prefix));
1590
1657
offset+=WriteBlob(image,sizeof(dpx.film.prefix),(unsigned char *)
1591
1658
dpx.film.prefix);
1592
1659
*dpx.film.count='\0';
1593
1660
value=GetDPXProperty(image_info,image,"dpx:film.count");
1594
1661
if (value != (const char *) NULL)
1595
(void) CopyMagickString(dpx.film.count,value,sizeof(dpx.film.count));
1662
(void) strncpy(dpx.film.count,value,sizeof(dpx.film.count));
1596
1663
offset+=WriteBlob(image,sizeof(dpx.film.count),(unsigned char *)
1597
1664
dpx.film.count);
1598
1665
*dpx.film.format='\0';
1599
1666
value=GetDPXProperty(image_info,image,"dpx:film.format");
1600
1667
if (value != (const char *) NULL)
1601
(void) CopyMagickString(dpx.film.format,value,sizeof(dpx.film.format));
1668
(void) strncpy(dpx.film.format,value,sizeof(dpx.film.format));
1602
1669
offset+=WriteBlob(image,sizeof(dpx.film.format),(unsigned char *)
1603
1670
dpx.film.format);
1604
dpx.film.frame_position=0UL;
1671
dpx.film.frame_position=0U;
1605
1672
value=GetDPXProperty(image_info,image,"dpx:film.frame_position");
1606
1673
if (value != (const char *) NULL)
1607
dpx.film.frame_position=(unsigned long) atol(value);
1674
dpx.film.frame_position=(unsigned int) atoi(value);
1608
1675
offset+=WriteBlobLong(image,dpx.film.frame_position);
1609
dpx.film.sequence_length=0UL;
1610
value=GetDPXProperty(image_info,image,"dpx:film.sequence_length");
1676
dpx.film.sequence_extent=0U;
1677
value=GetDPXProperty(image_info,image,"dpx:film.sequence_extent");
1611
1678
if (value != (const char *) NULL)
1612
dpx.film.sequence_length=(unsigned long) atol(value);
1613
offset+=WriteBlobLong(image,dpx.film.sequence_length);
1614
dpx.film.held_count=0UL;
1679
dpx.film.sequence_extent=(unsigned int) atoi(value);
1680
offset+=WriteBlobLong(image,dpx.film.sequence_extent);
1681
dpx.film.held_count=0U;
1615
1682
value=GetDPXProperty(image_info,image,"dpx:film.held_count");
1616
1683
if (value != (const char *) NULL)
1617
dpx.film.held_count=(unsigned long) atol(value);
1684
dpx.film.held_count=(unsigned int) atoi(value);
1618
1685
offset+=WriteBlobLong(image,dpx.film.held_count);
1619
1686
dpx.film.frame_rate=0.0f;
1620
1687
value=GetDPXProperty(image_info,image,"dpx:film.frame_rate");
1629
1696
*dpx.film.frame_id='\0';
1630
1697
value=GetDPXProperty(image_info,image,"dpx:film.frame_id");
1631
1698
if (value != (const char *) NULL)
1632
(void) CopyMagickString(dpx.film.frame_id,value,sizeof(dpx.film.frame_id));
1699
(void) strncpy(dpx.film.frame_id,value,sizeof(dpx.film.frame_id));
1633
1700
offset+=WriteBlob(image,sizeof(dpx.film.frame_id),(unsigned char *)
1634
1701
dpx.film.frame_id);
1635
1702
value=GetDPXProperty(image_info,image,"dpx:film.slate");
1636
1703
if (value != (const char *) NULL)
1637
(void) CopyMagickString(dpx.film.slate,value,sizeof(dpx.film.slate));
1704
(void) strncpy(dpx.film.slate,value,sizeof(dpx.film.slate));
1638
1705
offset+=WriteBlob(image,sizeof(dpx.film.slate),(unsigned char *)
1639
1706
dpx.film.slate);
1640
1707
offset+=WriteBlob(image,sizeof(dpx.film.reserve),(unsigned char *)
1741
1808
quantum_info->pack=dpx.image.image_element[0].packing == 0 ? MagickTrue :
1743
1810
quantum_type=RGBQuantum;
1744
length=GetBytesPerRow(image->columns,3,image->depth,MagickTrue);
1811
extent=GetBytesPerRow(image->columns,3,image->depth,MagickTrue);
1747
1814
quantum_type=GrayQuantum;
1748
length=GetBytesPerRow(image->columns,3,image->depth,MagickTrue);
1815
extent=GetBytesPerRow(image->columns,3,image->depth,MagickTrue);
1750
1817
pixels=GetQuantumPixels(quantum_info);
1751
1818
for (y=0; y < (long) image->rows; y++)
1753
p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
1820
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
1754
1821
if (p == (const PixelPacket *) NULL)
1756
(void) ExportQuantumPixels(image,quantum_info,quantum_type,pixels);
1757
count=WriteBlob(image,length,pixels);
1758
if (count != (ssize_t) length)
1823
(void) ExportQuantumPixels(image,(const ViewInfo *) NULL,quantum_info,
1824
quantum_type,pixels,&image->exception);
1825
count=WriteBlob(image,extent,pixels);
1826
if (count != (ssize_t) extent)
1760
1828
status=SetImageProgress(image,SaveImageTag,y,image->rows);
1761
1829
if (status == MagickFalse)