lexuanquyen / fjcore

Automatically exported from code.google.com/p/fjcore
0 stars 0 forks source link

Encoding a 8-bit Grayscale jpg fails (colorspace conversion bug) | Resubmit #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to encode a 8-bit Grayscale jpg

What is the expected output? What do you see instead?
Expected: Encoded image.
Actual: IndexOutOfException on Encoding (Line 261, "CompressTo"-method).

What version of the product are you using? On what operating system?
Original version (v1.0?) on. Vista Business SP1

Please provide any additional information below.
This is a Resubmit with more info. I first reported it as a comment on 
issue 1:

---
Comment 1 by snakeware95, Feb 03, 2009
Also there is a bug in the JpegEncoder constructor converting (8-bit) 
Grayscale images.

Replace:
_input.Image.ChangeColorSpace(ColorSpace.YCbCr);

With this to fix:
_input = new DecodedJpeg(_input.Image.ChangeColorSpace(ColorSpace.YCbCr), 
_input.MetaHeaders);

---
Comment 3 by jeff.powers, Feb 19, 2009
snakeware95: the colorspace change happens in-place so I
think that edit isn't needed.  resubmit a bug if problems remain.

---
The colorspace change itself is not the problem, but the properties of the 
surrounding DecodedJpeg (BlockWidth array f.e.) are not updated (still 1 
component). So when you loop over them using the Image.ComponentCount 
(which is 3 after the conversion) in "CompressTo", you get an 
IndexOutOfException on Encoding (Line 261, "CompressTo"-method).

Please try it yourself!

Original issue reported on code.google.com by snakewar...@gmail.com on 3 Mar 2009 at 12:48

GoogleCodeExporter commented 9 years ago
Here is the file i decode, resize and re-encode.

Original comment by snakewar...@gmail.com on 8 Apr 2009 at 11:21

Attachments:

GoogleCodeExporter commented 9 years ago
Will make sure this is fixed ASAP.

Original comment by jeff.pow...@gmail.com on 23 Apr 2009 at 6:41

GoogleCodeExporter commented 9 years ago
Hi Jeff,
I am also facing the above issue of Encoding a 8-bit Grayscale jpg fails and 
not sure if issue has been fixed. Its very urgent for me our project is already 
in production and client are complaining about it. I have to get it fix as it 
is high priority for my client.
I am using FJCore.dll version 1.0.0.0. Is there any new version released?
How can I download latest FJCore.dll Or source code ?

Thanks,
Sejal

Hope to hear from you soon.

Original comment by viroja.s...@gmail.com on 8 Aug 2014 at 2:24

GoogleCodeExporter commented 9 years ago
Hi Jeff,

I am writing you in order to follow up with the above issue. Are you going to 
accept an issue and find solution for it?
Hope to hear from you soon.

Thanks,
Sejal

Original comment by viroja.s...@gmail.com on 24 Dec 2014 at 2:41