PNG bug?

These two images should look identical. They look identical in my browser (Firebird), in my image viewer (irfan view) and in other programms too.

See for yourself:
PNGBug.jar (4kb - ugly useless source included)

The image labled with “/gfx/set_o.png” was produced by PNGCrush.

However, I don’t know if that image is kinda malformed or don’t fullfill the specs… but I thought here might be someone around who can check that.

edit: ooooh… forgot my system specs :-X

Running win98se, 1.4.2 (build 1.4.2-b28, mixed mode)

I get the same thing on a Mac. I think you can get a ‘pngcheck’ program that will validate the file to see that it follows the spec… google around… and you might as well file a bug now in any case if everything else doesn’t have the same problem.

pngcheck says that both files are ok. I also used a hex editor to create a broken file and indeed pngcheck reports it as broken.

Well… I won’t file a bug report, because I don’t know where, I don’t remember my login, the request login stuff doesn’t work and because I don’t want to register again.

In addition the bug report pages aren’t shown correctly in any of my browsers. It seems to depend on my resolution (800x600). Also searching something on Sun’s pages always gives me a headache… and I already have one.

You’re welcome to do that if you want to :slight_smile:

Not the 1st bug i’ve seen in Javas PNG codec,

Does it exhibit the same behaviour if you use ImageIO.read()? (I would test it myself… but its late :P)

also, does using a ‘proper’ Toolkit (as in 1 returned from a specific component, rather than Toolkit.getDefaultToolkit()) give correct results? (I doubt it will make any difference - but u never know :P)

I’d guess its the PNG codec not handling a 16color pallette properly.

As I said earlier, its not the 1st codec bug i’ve seen in Java, GIF images with the transparency color not at index 0 also behave incorrectly under certain circumstances.
/me searches for the Thread…
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1061208332;start=0#0

[quote][…]
Does it exhibit the same behaviour if you use ImageIO.read()? (I would test it myself… but its late :P)
[…]
[/quote]
It works with ImageIO… duh :o

Hadn’t thought that they use different decrunching methods (because it doesn’t make any sense).


Well… I won’t file a bug report, because I don’t know where, I don’t remember my login, the request login stuff doesn’t work and because I don’t want to register again.

The JDC request/reset login does ork, but for some reason it takes days for it to arrive in the inbox.

[quote]
Well… I won’t file a bug report, because I don’t know where, I don’t remember my login, the request login stuff doesn’t work and because I don’t want to register again.

The JDC request/reset login does ork, but for some reason it takes days for it to arrive in the inbox.
[/quote]
In the last 5 years, there has only been a period of about 4-6 months where a jdc login was required to log a bug, AFAIAA. Certainly, I’ve logged more than 50 bugs in that time, without ever using a JDC login.

I complained bitterly when they made logins compulsory late last year / early this year. I got the one response I didn’t expect: “But it’s always been that way…I’ve checked with the JDC team and they say you’ve always had to login”.

It took many weeks of me insisting I wasn’t insane, and that I could probably find thousands of people who would back me up, before the login requirement just one day vanished again. The contact at sun responsbile for my bug was particularly helpful - apparently he had to argue the case internally for quite a long time.

To quote Pratchett:
“I got nothing against [Sun]…it’s just that --”
“I know, I know,” said Lezek. “He couldn’t find his arse with both hands.”

I’ve never had a problem with filing bugs or searching for them either. If you want it fixed, file the bug.

I hate it when you happen to overhear your customers complaining about a problem you never knew you had because nobody ever bothered to tell you, particularly when it would be a simple fix. Man, I hate that. Tell Sun.

[quote]I’ve never had a problem with filing bugs or searching for them either. If you want it fixed, file the bug.

I hate it when you happen to overhear your customers complaining about a problem you never knew you had because nobody ever bothered to tell you, particularly when it would be a simple fix. Man, I hate that. Tell Sun.
[/quote]
If I want to file a bug I’ve to check if it was already mentionend. Searching and reading of an unknown number of bug reports… since they aren’t properbly displayed in my browser I would have to read the source of the pages - that means usually a lot of horizontal scrolling… that’s so much fun.

All I wanted to is pointing that bug out (validate and checking on other platforms)… the actual bug filing should be done by someone else, who can do that without a pain in the arse, writes good english and doesn’t sound that mean and pissed of as I do :slight_smile:

Happy to report, it’s fixed in 1.5…
There were a lot of fixes in this area…

Oh sure make it easy for him! He doesn’t even have to report the bug and it gets fixed anyway :stuck_out_tongue:

Really looking forward to seeing a 1.5 beta/EA release…

[quote]Oh sure make it easy for him! He doesn’t even have to report the bug and it gets fixed anyway :stuck_out_tongue:
[…]
[/quote]
You said, that you don’t have any probs with filing a bug report, but I do have problems with that… I even tried to explain the details.

Arguing won’t magically enhance my monitor nor the login-request thingy would begin working.

All I did was asking for a small “never had a problem with”-favour, but you are right. It’s my bug and my fault (because I found it) therefore I have to report it even if it takes 10 to 20 times longer if I have to do it.

Yea… I’m sucha lazy SOB. Coding 10 hours per day, doing stuff for 2 modifications and administrate a board with over 17k registered users just doesn’t cut it.

See? I always sound pissed off. Well… ok this time it’s intentional :stuck_out_tongue:

@ trembovetski

Thanks for the info :slight_smile:

Seriously, what system are you using that has so many problems with the Java bug reporting pages?

I wouldn’t make that much effort either ;D - I just don’t get why it’s like that for you???. You seem to have a broken system. I’ve reported Java bugs on Windows, with IE, Opera, Mozilla, Firebird; on Linux with Mozilla, Opera; on Mac with Safari… and I have never had a problem with the site.
Just for the heck of it I started the process using Konqueror and it seemed to be working fine… :-/

Maybe you are referring to the problem when browsing bug reports with the bug report text not wrapping so you have to make the browser window wide to view it? I DO get that - but I just make the window big enough and it isn’t a problem.

As if you could make the window big enough if you have to use 800x600 ::slight_smile:

(A new monitor is on first place on my toBuy list).

And my system is fine, thanks :wink:

why do u use png ? i never used png or gif format, i use my own format and never had problems with it, its much smarter

[quote]have to use 800x600
[/quote]

[quote]And my system is fine, thanks :wink:
[/quote]
These two statements contradict each other ;D

As for why use PNG? A better question is why not? It is built-in to the JRE and is a generally decent lossless format that supports most of what you would ever need. The world does not need yet another 2d graphic file format, there are already too many.

Ahem. I’m still awaiting JPG-2000, and full-on wavelet compression. (…and I’ve been waiting for many years :frowning: )

c.f. http://jpeg2000.epfl.ch/ for a basic java implementation.

But, agreed, until it arrives (they finish writing the standard, and it gets wide support, etc), PNG is probably the best lossy format (nb: not good IMHO for lossless compression - tools and users have a habit of using the lossy compression, which is a PITA when unwanted and the original file gets overwritten. TGA etc are at least safe in this regard…)

EDIT: FYI JPEG-2000 provides lossless compression at similar ratios to much of the decent-quality lossy compression. It’s rather good :slight_smile:

You can use JPEG 2000 now with ImageIO if you download the IO pack for JAI. I’m not sure if the IO pack is released now (not early access) so that you can distribute it with your apps… I think so, but would have to check to be sure.

PNG is not lossy, it has no option for being lossy. So as for being the best lossy format ???

JPEG 2000 is good… very good at vary high lossy compresson ratios… but the format is also very complex. Or perhaps better stated it can be very complex, supporting regions of interest and tiles etc…

I have not seen any thing to compare it’s performance with lossless compression, but I believe that it would do well.

JPEG 2000 is also rather slow to encode/decode, probably simply because the current implementations have not matured.

It just so happens that the company I work for is using JPEG 2000 hardware for a high definition video product (with a nice cross-platform Java UI). So if you know of some good & fast JPEG 2000 codecs I’m particularly interested.

[quote]You can use JPEG 2000 now with ImageIO if you
[/quote]
Yup, but ask an artist to produce that format and you’re just going to get funny looks :(. The standard itself is also not finished, and the reference implementations appear to be pretty crude (only the most basic support so far, because the extensions haven’t been fully defined yet?)

Now that you say that, and I’ve thought about it a bit more…sorry, I was being stupid :). I’m not sure what I was thinking of, except that I remembered I’d had problems before with being supplied low-quality PNG’s. My best guess is that we were being given JPG’s that were being converted to PNG too late in the production process. Hmm.

It’s been a long time since I looked at PNG’s in technical terms. Oops.

I had a Professor who was an expert on Wavelet compression, and I’ve still got a big stack of notes from his lectures. I spent more time than I care to recall looking at wavelets and working through the maths behind them…

But since nearly all of us aren’t ever going to (need to) write our own codecs, like other “difficult” algos (MPEG-4?) most of us will never need to worry about complexity, except where it hogs CPU power…?

[quote]It just so happens that the company I work for is using JPEG 2000 hardware for a high definition video product (with a nice cross-platform Java UI). So if you know of some good & fast JPEG 2000 codecs I’m particularly interested.
[/quote]
Several years ago, I worked for a company writing medical imaging software that used wavelet-based compression techniques to work with large videos like angiograms/cardiograms, etc… The stuff people usually provide in DICOM format.

Anways, one of the guys I worked with was a graduate from Georgia Tech’s PhD EE program in DSP - which is pretty much reknown for being top of class. I could hook you two up. He might have a pretty good idea of how you go about obtaining a good JPEG2000 implementation. Send me an e-mail if you’re interested - toby@reyelts.com.

As a side note, yes, JPEG2000 should do lossless compression pretty darn well, as it’s based on the same wavelet-based techniques that we were using for our own proprietary lossless codec.

God bless,
-Toby Reyelts