Skip to content
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

Support the Baseline TIFF 'metadata' tags (all ASCII) when writing #430

Open
timhj opened this issue Jun 19, 2024 · 2 comments
Open

Support the Baseline TIFF 'metadata' tags (all ASCII) when writing #430

timhj opened this issue Jun 19, 2024 · 2 comments

Comments

@timhj
Copy link
Contributor

timhj commented Jun 19, 2024

There are 5 tags available in the Baseline TIFF spec which are useful to put additional ASCII information into created files using writeArrayBuffer but the metadata doesn't exist or isn't able to be inserted because the tagTypes fail a lookup test and throw error eg Error: unknown type of tag: (270,271,272,315 or 33432) when they're added as metadata. There must be a lookup happening as when the tags are specified with their name, the error returned is with the correct associated Tag Code for that type name.

ASCII type tags not currently supported for writing:

Artist: 'Person who created the image.', // 315 (hex 0x013B) 
ImageDescription: 'A string that describes the subject of the image.',  // 270 (hex 0x010E)
Copyright: 'Copyright from original source image' // 33432 (hex 0x8298)
Make: 'The scanner manufacturer.', // Code	271 (hex 0x010F)
Model: 'The model name or number of the scanner, video digitizer, or other type of equipment used to generate the image.', // 272 (hex 0x0110)

The above are all ASCII type tags and listed with the Tag code as a comment at the end. Adding support to the writer for this metadata would be a useful addition to the library.

Full list of baseline tags is here: https://www.awaresystems.be/imaging/tiff/tifftags/baseline.html

@timhj timhj changed the title Support the Baseline TIFF metadata tags (all ASCII) when writing Support the Baseline TIFF 'metadata' tags (all ASCII) when writing Jun 19, 2024
@DanielJDufour
Copy link
Contributor

Great idea! Would you be interested in submitting a PR? Indeed you are correct that a lookup is happening in geotiffwriter that is referencing globals.js. I think adding this info to globals.js would fix the problem, but adding a test is always a good idea, too!

timhj added a commit to timhj/geotiff.js that referenced this issue Jun 20, 2024
Mapping the Baseline ASCII TIFF Tags to an ASCII data type to allow for writing of them.

geotiffjs#430
@timhj
Copy link
Contributor Author

timhj commented Jun 20, 2024

@DanielJDufour - Done, PR requested. Unit test not written but have built and tested the changes and all worked as expected (Error: unknown type of tag: errors are gone, Metadata is written to appropriate fields and visible in Image viewers.

Thanks for all your work on a great library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants