-
Notifications
You must be signed in to change notification settings - Fork 63
add support for writing geotiff tags, using only a GDL procedure. #1525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you very much @GillesDuvert ! While testing it I found the following issues:
Because of the keyword "string" appearing twice in the parameters definition:
Could you please review it? |
Oh I even did not bother to check WRITE_TIFF, as updategeotagsinimage was a bit challenging. |
Here's the structure:
|
Ah, one works4me:
|
Yes, works for me as well using a=dist(256).
Try it with a=fltarr(100,200) and you will get the error :-(
… On 27. Feb 2023, at 15:51, Giloo ***@***.***> wrote:
Ah, one works4me:
GDL> restore,file="geotiff_tag.sav" & a=dist(256) & write_tiff,"toto.tiff",a,geo=geo
GDL>
$ exiftool -D -G -a -u -U -f toto.tiff
[ExifTool] - ExifTool Version Number : 12.00
[ExifTool] - Warning : Suspicious IFD0 offset for PixelScale
[ExifTool] - Warning : Suspicious IFD0 offset for ModelTiePoint
[File] - File Name : toto.tiff
[File] - Directory : .
[File] - File Size : 65 kB
[File] - File Modification Date/Time : 2023:02:27 19:49:34+01:00
[File] - File Access Date/Time : 2023:02:27 19:49:34+01:00
[File] - File Inode Change Date/Time : 2023:02:27 19:49:34+01:00
[File] - File Permissions : rw-rw-r--
[File] - File Type : TIFF
[File] - File Type Extension : tif
[File] - MIME Type : image/tiff
[File] - Exif Byte Order : Little-endian (Intel, II)
[EXIF] 256 Image Width : 256
[EXIF] 257 Image Height : 256
[EXIF] 258 Bits Per Sample : 8
[EXIF] 259 Compression : Uncompressed
[EXIF] 262 Photometric Interpretation : BlackIsZero
[EXIF] 266 Fill Order : Normal
[EXIF] 273 Strip Offsets : 8
[EXIF] 274 Orientation : Horizontal (normal)
[EXIF] 277 Samples Per Pixel : 1
[EXIF] 278 Rows Per Strip : 256
[EXIF] 279 Strip Byte Counts : 65536
[EXIF] 284 Planar Configuration : Chunky
[EXIF] 297 Page Number : 0 1
[EXIF] 318 White Point : 0.3127000034 0.3289999962
[EXIF] 319 Primary Chromaticities : 0.6399999857 0.3300000131 0.3000000119 0.6000000238 0.150000006 0.05999999866
[GeoTiff] 1 Geo Tiff Version : 1.1.2
[GeoTiff] 1024 GT Model Type : Projected
[GeoTiff] 1025 GT Raster Type : Pixel Is Area
[GeoTiff] 2050 Geog Geodetic Datum : WGS84
[GeoTiff] 2056 Geog Ellipsoid : WGS 84
[GeoTiff] 3072 Projected CS Type : WGS84 UTM zone 23S
[GeoTiff] 3073 PCS Citation : Christians Text
[GeoTiff] 3076 Proj Linear Units : Linear Meter
[GeoTiff] 3080 Proj Nat Origin Long : -45
[GeoTiff] 3081 Proj Nat Origin Lat : -45
[GeoTiff] 3082 Proj False Easting : -45
[GeoTiff] 3083 Proj False Northing : -45
[GeoTiff] 3092 Proj Scale At Nat Origin : -45
[Composite] - Image Size : 256x256
[Composite] - Megapixels : 0.066
—
Reply to this email directly, view it on GitHub <#1525 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AOC5K6FPPK2YLOIKV4ZUCGTWZTZS3ANCNFSM6AAAAAAVIX5XAQ>.
You are receiving this because you commented.
|
This looks like a padding error |
should pass now |
Hi @GillesDuvert today I tested the new write_tiff procedure and I think we are on the right way. I have the following remarks:
How complicated is it to implement the float keyword to write a float array as a single band float image? |
In fact I'm working on a full-fledged TIFF_WRITE, as it is quite simple to make a TIFF file in GDL. Besides, ImageMagick does not permit to write all supported options, like Float,Complex etc. Stay tuned. |
noice!
… On 10. Mar 2023, at 20:01, Giloo ***@***.***> wrote:
In fact I'm working on a full-fledged TIFF_WRITE, as it is quite simple to make a TIFF file in GDL. Besides, ImageMagick does not permit to write all supported options, like Float,Complex etc. Stay tuned.
—
Reply to this email directly, view it on GitHub <#1525 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AOC5K6CESCACFGHJCXZL6X3W3OXDFANCNFSM6AAAAAAVIX5XAQ>.
You are receiving this because you commented.
|
"The image is written upside down by default" IDL test of: |
Anyway, it is different from IDL and not “natural”.Let’s change it if possible.On 10 Mar 2023, at 20:47, Giloo ***@***.***> wrote:
"The image is written upside down by default"
IDL test of: window,xsize=256,ysize=256 & plot,dist(20)&a=tvrd()&write_tiff,'idl.tiff',a
and IDL> $display idl.tiff
'display' plots the image upside-down.
This probably because of this IDL note
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
@GillesDuvert how is the actual status of write_tiff? For me the images still are written upside down and I get a crash when I execute the write_tiff command twice. Could you please test? Example that shows that the image is written upside down:
If you open both Geotiffs you will see that the test_out.tif is upside down. Look at this:
Example that shows the crash when executing the write_tiff command twice:
Thanks for any help! |
@brandy125 👍 all those bugs must be cured, and should be reported in the testsuite. |
@brandy125 For the record, |
I know this. Maybe I did not express myself well. I wrote:
Instead I wanted to say:
So if you execute this command:
The image was displayed in the correct order
The !order variable is 0 as it should be
After the write_tiff command the image will be displayed upside down. This can only happen if the !order variable is 1 now.
The !order variable is still 0, so how can this happen? |
hah, but thats easy 😄 : the write_tiff procedure contained calls to reverse() that affected the passed array and not a local copy. |
Nice, I just tested and it works fine now! Thanks! If you can resolve the issue with the crash when executing write_tiff two times then for me everything is fine.
What could be the problem here? The crash happens with any geotiff. When executing the write_tiff command two times it crashes. |
Sorry, forget the above post. Everything works fine now. |
BTW, this new version introduced a bug. Should I open a new issue for it? The following program does not compile because of the "$"
|
OK, this is related to the correction of #52 . Clearly not OK. I open an issue. |
Not wanting to mess up with the excellent work from @rexso , I found amusing to check if this could be done only with a GDL procedure. This is the result, adding GEOTIFF=struct to WRITE_TIFF
needs testing.