Mercurial > octave-libtiff
diff scripts/image/private/__tiff_imfinfo__.m @ 31202:be6ccdcd5775
Tiff: added isBigEndian and getDirectoryOffset methods to the class
* scripts/io/Tiff.m: added isBigEndian and getDirectoryOffset methods
to the class.
* libtinterp/corefcn/tiff.cc: added __tiff_is_big_endian__ and
__tiff_get_directory_offset__ as internal functions for isBigEndian
and getDirectoryOffset repectively.
* scripts/image/private/__tiff_imfinfo__.m: used the two new methods
to get the corresponding info fields.
author | magedrifaat <magedrifaat@gmail.com> |
---|---|
date | Fri, 02 Sep 2022 21:20:56 +0200 |
parents | e5e8cb049b4b |
children |
line wrap: on
line diff
--- a/scripts/image/private/__tiff_imfinfo__.m Fri Sep 02 20:52:47 2022 +0200 +++ b/scripts/image/private/__tiff_imfinfo__.m Fri Sep 02 21:20:56 2022 +0200 @@ -17,7 +17,7 @@ for dir_idx = 1:dir_count info(dir_idx).Filename = filename; info(dir_idx).FileModDate = strftime ("%e-%b-%Y %H:%M:%S", - localtime (file_stat.ctime)); + localtime (file_stat.mtime)); info(dir_idx).FileSize = file_stat.size; info(dir_idx).Format = "tif"; info(dir_idx).FormatVersion = ""; @@ -73,12 +73,11 @@ endif endif - ## FIXME: implement isBigEndian - # if (tif.isBigEndian ()) - # info(dir_idx).ByteOrder = "big-endian"; - # else - # info(dir_idx).ByteOrder = "little-endian"; - # endif + if (tif.isBigEndian ()) + info(dir_idx).ByteOrder = "big-endian"; + else + info(dir_idx).ByteOrder = "little-endian"; + endif info(dir_idx).NewSubFileType ... = get_tag_defaulted (tif, Tiff.TagID.SubFileType, @@ -153,8 +152,7 @@ = get_tag_defaulted (tif, Tiff.TagID.Thresholding, Tiff.Thresholding.BiLevel); - ## FIXME: implement getDirectoryOffset method - # info(dir_idx).Offset = tif.getDirectoryOffset (); + info(dir_idx).Offset = tif.getDirectoryOffset (); info(dir_idx).ImageDescription ... = get_tag_defaulted (tif, Tiff.TagID.ImageDescription, "");