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

RasterCount check for JPEGs #187

Open
zmoon opened this issue Oct 23, 2024 · 2 comments
Open

RasterCount check for JPEGs #187

zmoon opened this issue Oct 23, 2024 · 2 comments

Comments

@zmoon
Copy link
Contributor

zmoon commented Oct 23, 2024

onearth/src/mrfgen/mrfgen.py

Lines 1894 to 1897 in 628ccc0

if img.RasterCount == 1:
log_sig_err("Bad JPEG tile detected: {0}".format(tile), sigevent_url)
img = None
continue

For my example I'm working, which @jtroberts helped with, I had to disable this check so my input files weren't skipped. But mrfgen seemed to work fine. My files for now are one-band grayscale instead of three-band RGB.

Some thoughts:

  • Is grayscale considered okay for OnEarth/mrfgen? If not, the error message could mention that.
  • If it is, if colormap in the mrfgen config is not set or something, assume grayscale and check that img.RasterCount is 1 (or 3 if colormap is set)
@jtroberts
Copy link
Member

I don't think we've tried one-band JPEG inputs for mrfgen. One-band grayscale PNG or TIFF inputs are okay, but not JPEG. I don't recall if there was a technical reason that it can't be supported or that we simply never came across it before. We can try removing the highlighted lines and do some testing.

Colormap is only needed when mrf_compression_type is set to "PPNG" (8-bit Palette PNGs). If you set mrf_compression_type to JPEG or PNG then it should produce a one-band grayscale MRF. What are you setting mrf_compression_type to?

@zmoon
Copy link
Contributor Author

zmoon commented Oct 23, 2024

Colormap is only needed when mrf_compression_type is set to "PPNG" (8-bit Palette PNGs). If you set mrf_compression_type to JPEG or PNG then it should produce a one-band grayscale MRF. What are you setting mrf_compression_type to?

 <mrf_compression_type>JPEG</mrf_compression_type>
 <colormap></colormap>

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