haraldk / TwelveMonkeys

TwelveMonkeys ImageIO: Additional plug-ins and extensions for Java's ImageIO
https://haraldk.github.io/TwelveMonkeys/
BSD 3-Clause "New" or "Revised" License
1.89k stars 313 forks source link

Warning system custom messages #967

Open JacobGreen082 opened 3 months ago

JacobGreen082 commented 3 months ago

I'm having a problem with twelve monkeys, we repeatedly get this error message,

I want to add more to the warning message to better explain it, how can I adjust it?

haraldk commented 3 months ago

Hi Jacob,

I'm afraid I don't understand the question... Are you saying you get this message from the library? In that case, please include the stack trace, library version and more detail on how to reproduce. I really don't recognize this message and can't find it anywhere in our code...

Or are you asking about how to create better warning message in your own code? For that, please use Stack Overflow, Code Review or other Q & A/forum type site.

JacobGreen082 commented 3 months ago

@haraldk I'm new to this project so bare with me. I found the code we are using to trigger this warning but still looking for a possible solution image This is an example of the data its having trouble with image

haraldk commented 3 months ago

I'm still not exactly sure what your question is (other how you can adjust your warning message, which is not something I can help with)... The screenshot above does not contain TwelveMonkeys library code or code I am familiar with.

But here are some general tips on how to get better help:

  1. Ask specific questions about specific problems (this requires an understanding of your own code or the code you are asking about)
  2. Don't post code as images, that is just annoying. Post as text with proper formatting (Github MD has Java code style support). Also, don't just post your full code, post only the code relevant to the issue.
  3. Don't post log excerpts as images, that is just annoying. Again, post as text with proper formatting.

That said, my guess about what your issue is, is that you are somehow using the TwelveMonkeys low-level TIFF metadata API to extract metadata, and see that the valueCount field is 1 for string values (if the entry contains a single string). This differs from the native "value count" inside the TIFF structure, which for ASCII type fields is the number of characters (bytes), including null-term.

But why this is a problem or what I can do to help is still unclear, as I don't know what you use this value for (other than comparing with some other value...).