Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Premature end of JPEG file

Subject: Premature end of JPEG file

From: Oliver Warlow

Date: 28 Jan, 2011 15:32:03

Message: 1 of 4

I am running a script to load in some jpegs from an ultrasound scanner. When I load in the file using imshow I get the following warning:
Warning: Premature end of JPEG file

despite getting this warning I cans still view the image ok and take the measurments from it that I require. Can anyone think why I might be getting this warning despite the file still being readable? Unfortunately the ultrasound scanner is very basic and the only output format seems to be jpeg.
thanks
Oli

Subject: Premature end of JPEG file

From: Joseph

Date: 28 Jan, 2011 17:14:03

Message: 2 of 4

Haha, you probably just have to work on your self control...

But everything I've seen on this indicates it's probably a corrupt .jpeg file

"Oliver Warlow" wrote in message <ihunhj$ame$1@fred.mathworks.com>...
> I am running a script to load in some jpegs from an ultrasound scanner. When I load in the file using imshow I get the following warning:
> Warning: Premature end of JPEG file
>
> despite getting this warning I cans still view the image ok and take the measurments from it that I require. Can anyone think why I might be getting this warning despite the file still being readable? Unfortunately the ultrasound scanner is very basic and the only output format seems to be jpeg.
> thanks
> Oli

Subject: Premature end of JPEG file

From: Oliver Warlow

Date: 31 Jan, 2011 15:55:05

Message: 3 of 4


> But everything I've seen on this indicates it's probably a corrupt .jpeg file

I assumed it was a corrupt file, however I am still able to open the file ok. Doyou think the corruption will have an effect on the image itself?

Oli

Subject: Premature end of JPEG file

From: ImageAnalyst

Date: 31 Jan, 2011 19:21:45

Message: 4 of 4

Oliver Warlow:
Who knows? Maybe the last few lines are missing. Maybe the last
pixel is missing. Does anything look weird down there? If not, maybe
it won't affect your work and you can just suppress the warning or
ignore it by wrapping the code in a try/catch. What it did read in
was probably intact and accurate if it looks okay, but who knows what
might be missing?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us