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

No byte swap for FLIR png with new "Import with defaults" #8

Closed
KlMichel opened this issue Jul 14, 2022 · 3 comments
Closed

No byte swap for FLIR png with new "Import with defaults" #8

KlMichel opened this issue Jul 14, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@KlMichel
Copy link

Hello Glenn,
thanks a lot that you took the time to add the "Import FLIR JPG with defaults" with ThermimageJ-2.6. Being a bit lazy, I realized this not before yesterday.
However, I found that it works nicely with FLIR tiff files but it fails to perform the "byte swap" for png files. As a workaround I added the following lines in your code (after line 1191):

if(RawThermalType == "PNG" && ConvertWithDefault == "yes"){
run("Byte Swapper");
}

I tested it with the sample files that are included in "ThermImageJ-2.6" and my image files. Both the normal import (with parameter dialog) and the new import with defaults seem to work but probably it can be done more elegant.

Best, Klaus

@gtatters
Copy link
Owner

Hi Klaus
Sorry I'm in the field and travelling away from computer a lot so will see about adding this in a future update. I'm glad you figured out a work-around - it suggests my code is somewhat decipherable.

Reasons why I have been hesitant to do this particular decision when importing is because I am not convinced that FLIR is ever consistent in the byte ordering between cameras or software. Thus, if I assume the PNG style data need to have the byte order swapped, I suspect we'll find a different image from a different flir camera that doesn't need it! So I might add your suggestion but need to keep an eye out in case it breaks import for some other files.

Best
Glenn

@gtatters
Copy link
Owner

ok, I've added your code to v2.7.

Tested with a number of images I have and it seems to work.

Thanks for the suggestion!

@gtatters gtatters added the enhancement New feature or request label Jul 15, 2022
@KlMichel
Copy link
Author

KlMichel commented Jul 15, 2022 via email

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

No branches or pull requests

2 participants