Invalid Jpeg Marker Type

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Invalid Jpeg Marker Type

Alison Payne
Hi,

I am writing a jpg file from an imagej plugin with the following command :

IJ.run(FinalResultFIN,"Save", "save=["+directory+title+"_7Results.jpg]");

Once the file is written (e.g. IMG_3019.jpg_7Results.jpg), it cannot be opened in any of google chrome, IE, or Adobe Photoshop.  Adobe Photoshop gives the error "Could not complete your request because an unknown or invalid JPEG marker type is found."

Is there anything I can do to get imagej to write a file which doesn't have this unknown/invalid jpg marker type?

Kind Regards,
Alison
Reply | Threaded
Open this post in threaded view
|

Re: Invalid Jpeg Marker Type

dscho
Dear Alison,

On Mon, 15 Aug 2011, Alison Payne wrote:

> I am writing a jpg file from an imagej plugin with the following command :
>
> IJ.run(FinalResultFIN,"Save", "save=["+directory+title+"_7Results.jpg]");
>
> Once the file is written (e.g. IMG_3019.jpg_7Results.jpg), it cannot be
> opened in any of google chrome, IE, or Adobe Photoshop.  Adobe Photoshop
> gives the error "Could not complete your request because an unknown or
> invalid JPEG marker type is found."

Please provide enough information/data to reproduce. For example, a TIFF
of the offending image would be good, and a sample invalid .jpg file
would not hurt, either.

In your particular case, I could imagine that the "Save" command is not
appropriate; it writes out Tiff files.

A more appropriate call would most likely look like this:

        IJ.saveAs(FinalResultFIN, "jpeg", directory+title+"_7Results.jpg");

Be aware, though, that Jpeg files have so serious artifacts that you must
not perform analyses on them unless you want to risk your scientific
reputation. Jpeg is only good for visualization, and only when file size
is an issue.

Ciao,
Johannes