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

OutOfMemoryError getting metadata when IFD contains large byte values #44

Open
gmishkin opened this issue Jul 6, 2017 · 0 comments
Open

Comments

@gmishkin
Copy link

gmishkin commented Jul 6, 2017

I have XMP data in a TIFF I'm reading (it's large, about 30 MB, but not OutOfMemoryError large).

I set the field type as byte as based on XMP docs. But the way it gets set up in

if (field.getType() == TIFFTag.TIFF_UNDEFINED) {
is that it creates an IIOMetadataNode for each byte. I think this is the part that causes the memory error.

As a workaround I changed the type to undefined in my file.

I was just wondering if this behavior could be changed, as TIFFField.getAsBytes() also supports TIFFTag.TIFF_BYTE. Since many cases where you are using the byte type would be for long tag values like this, you wouldn't want it creating metadata nodes for each individual byte.

Of course, the native metadata format could be documented somewhere as "fields of type byte are always split up into a list of child metadata nodes" and then you probably wouldn't want to change this.

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

1 participant