-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix expection when image has only one iptc tag. #38
Conversation
…should not cause expection.
@sinedsem Can you let me know more details about where exactly the exception was thrown? I don't think the ArrayUtils.subArray itself is wrong. When image has one IPTC tag, the offset should be 0 instead of src.length = 1. |
@dragon66 hello.
ITPC metadata was inserted there with https://github.com/vnesek/nmote-iim4j . |
@sinedsem Thanks for your details. I found the issue: in the original image, there are actually two IPTC tags instead of one. One is named ObjectName and the other is Keywords. The data size for the second one is 0 which breaks icafe. The straightforward fix for this one is to add a check to IPTC.java inside read() to not create IPTCDataSet if the data size is 0. Something like this:
I will check in a new fix later. |
Great, thank you! |
@sinedsem hello, I have updated the repository with fix for this bug. Please take a look and see if it works for you or not. The following is what I got from the one_IPTC_tag.jpg you provided after the fix and Metadata entry 1 is related to IPTC:
|
@dragon66 hello. |
When image has only one iptc tag offset == src.length. It is a valid case, but exception is thrown when reading metadata.