We're Hiring!

JPEG 8-bit Grayscale not supported?

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

JPEG 8-bit Grayscale not supported?

Postby darwinjob » Mon Oct 30, 2017 3:48 pm

Hi
I get unexpected results when I try to read and save 512x512 piece from JPEG image:
Code: Select all
public class TestReader {
   public static void main(String[] args) throws FormatException, IOException {
      ImageReader tr = new ImageReader();
      tr.setId("E:/tmp/T1_3_1_SST11D_0159.jpg");
      BufferedImageReader bir = new BufferedImageReader(tr);
           BufferedImage bi = bir.openImage(0, 10000, 10000, 512, 512);
      File outputfile = new File("saved.png");
      ImageIO.write(bi, "png", outputfile);
      bir.close();
   }
}


Image

The input file: http://folk.uio.no/dmitrd/bio-formats/T ... D_0059.jpg

Version 5.7.1, W764
darwinjob
 
Posts: 18
Joined: Mon Sep 16, 2013 11:58 am

Re: JPEG 8-bit Grayscale not supported?

Postby rleigh » Tue Oct 31, 2017 5:18 pm

Thank you for providing the sample file. I can reproduce this and I get exactly the same result as in the image you posted. I've opened https://trello.com/c/BzUB5Fuw/196-jpegr ... eg-failure for further investigation. There seems to be both excessively high memory usage and a failure to return valid pixel data.

The original file seems fine. I can open this with several tools using libjpeg-turbo to read the file, which is what the Bio-Formats JPEG reader is using itself.

Regards,
Roger
User avatar
rleigh
 
Posts: 217
Joined: Tue Mar 13, 2012 11:45 am

Re: JPEG 8-bit Grayscale not supported?

Postby dgault » Thu Apr 05, 2018 1:49 pm

As a follow up to this issue, a fix has now been put in place and will be included in the upcoming release of Bio-Formats 5.8.2.

https://github.com/openmicroscopy/bioformats/pull/3114
https://trello.com/c/BzUB5Fuw/10-jpegre ... pixel-data
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: JPEG 8-bit Grayscale not supported?

Postby darwinjob » Tue Jun 19, 2018 4:47 pm

OK, this one seems to be fixed, thank you. But now it looks like JPEG-compressed TIFFs are broken :evil:
See separate thread viewtopic.php?f=13&t=8527
darwinjob
 
Posts: 18
Joined: Mon Sep 16, 2013 11:58 am


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest

cron