Skip to content

Commit

Permalink
support date:timestamp property
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jun 11, 2022
1 parent f200174 commit cf7dc08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 10 additions & 6 deletions coders/tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,16 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
}
option=GetImageOption(image_info,"quantum:polarity");
if (option == (const char *) NULL)
option=GetImageArtifact(image,"tiff:photometric");
if (option != (const char *) NULL)
{
if (LocaleCompare(option,"min-is-black") == 0)
SetQuantumMinIsWhite(quantum_info,MagickFalse);
if (LocaleCompare(option,"min-is-white") == 0)
SetQuantumMinIsWhite(quantum_info,MagickTrue);
}
if ((LocaleCompare(image_info->magick,"PTIF") == 0) &&
(GetPreviousImageInList(image) != (Image *) NULL))
(void) TIFFSetField(tiff,TIFFTAG_SUBFILETYPE,FILETYPE_REDUCEDIMAGE);
Expand All @@ -3227,17 +3237,11 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
case FaxCompression:
{
compress_tag=COMPRESSION_CCITTFAX3;
option=GetImageOption(image_info,"quantum:polarity");
if (option == (const char *) NULL)
SetQuantumMinIsWhite(quantum_info,MagickTrue);
break;
}
case Group4Compression:
{
compress_tag=COMPRESSION_CCITTFAX4;
option=GetImageOption(image_info,"quantum:polarity");
if (option == (const char *) NULL)
SetQuantumMinIsWhite(quantum_info,MagickTrue);
break;
}
#if defined(COMPRESSION_JBIG)
Expand Down
2 changes: 2 additions & 0 deletions magick/constitute.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ MagickExport Image *ReadImage(const ImageInfo *image_info,
}
if (source_date_epoch == (const char *) NULL)
{
(void) FormatMagickTime(GetMagickTime(),MaxTextExtent,timestamp);
(void) SetImageProperty(next,"date:timestamp",timestamp);
(void) FormatMagickTime((time_t) GetBlobProperties(next)->st_mtime,
MaxTextExtent,timestamp);
(void) SetImageProperty(next,"date:modify",timestamp);
Expand Down

0 comments on commit cf7dc08

Please sign in to comment.