dcmj2pnm creating corrupted JPGs

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
robertsdavidb
Posts: 17
Joined: Thu, 2012-09-27, 09:12

dcmj2pnm creating corrupted JPGs

#1 Post by robertsdavidb »

I use dcmj2pnm to export jpegs.

Code: Select all

dcmj2pnm +oj dicom_file dicom_file.jpg
If I set the quality to 99 with the +Jq flag, and then choose either +Wm or +Wn for windowing, I get a corrupted JPG that crashes Chrome.

Code: Select all

dcmj2pnm +Wm +oj +Jq 99 dicom_file dicom_file.jpg
Granted, setting the quality to 99 isn't very useful, but I cannot figure out what's wrong with these images. It works properly with +Jq 99 until I add in a windowing flag.

Here is the dicom file -> http://cruciallab.com/dicom/dicom_file
Here is the jpg output -> http://cruciallab.com/dicom/dicom_file.jpg

Sometimes, the JPG will load the first try, but if you refresh, it will "oh snap" the browser.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: dcmj2pnm creating corrupted JPGs

#2 Post by J. Riesmeier »

So, the referenced JPEG file should crash my browser or image viewer?

I tested it with Chromium and Firefox as well as Gimp (all on Linux). All three were able to read and display the image. Even multiple times :)

Here's the output of "jhead":

Code: Select all

File name    : dicom_file.jpg
File size    : 1160997 bytes
File date    : 2016:02:26 16:53:08
Resolution   : 2140 x 1760
Color/bw     : Black and white
JPEG Quality : 98
Maybe, your Chrome browser is buggy!?

robertsdavidb
Posts: 17
Joined: Thu, 2012-09-27, 09:12

Re: dcmj2pnm creating corrupted JPGs

#3 Post by robertsdavidb »

Thanks for your reply J.

I should have clarified that I have tested this on multiple windows machines, using various DICOM images .. and running dcmj2pnm on windows and Linux.

Are you able to look at the image on a Windows Chrome installation?

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: dcmj2pnm creating corrupted JPGs

#4 Post by J. Riesmeier »

Are you able to look at the image on a Windows Chrome installation?
Yes, I can confirm this. The InternetExplorer does not show this behavior.

So, it seems to be a bug in Chrome (Windows).

robertsdavidb
Posts: 17
Joined: Thu, 2012-09-27, 09:12

Re: dcmj2pnm creating corrupted JPGs

#5 Post by robertsdavidb »

The images seem to work fine in IE, but FF displays some of them skewed as well.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: dcmj2pnm creating corrupted JPGs

#6 Post by J. Riesmeier »

But only on Windows...

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest