For Programmers: Free Programming Magazines  


Home > Archive > Java Help > August 2007 > Re: Jpeg encoder exception: Trying to make a thumbail from a jpeg









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Jpeg encoder exception: Trying to make a thumbail from a jpeg
Joshua Cranmer

2007-08-26, 7:19 pm

lovaspillando wrote:
> Hi:


Please don't multi-post. If you must post to two newsgroups, specify
both newsgroups in your news client /at the same time/.
>
> I have a web application in asp.net wich I am rewriting to Java. Is
> about uploading pictures online. Web system upload perfectly
> pictures, but in original size. I would like to upload too a thumbail
> version of the big picture. For that, I am using Jpegencoder from
> sun, and seems I am doing something bad, coz when I am trying to do
> that I get a exception: "nof a jpeg file: start " and so on...


If it's not a JPEG, using a JPEG to decode won't work.

> I get the file data from a fileupload (apache commons fileupload), and
> since I get the byte array of each picture I save it into a bussiness
> object.
>
> The complete code is in here, just in case someone of you could help
> me. I am getting extressed coz dont know what coulb be wrong, if
> somone of you could help it will be more than great!. Thank you for
> your help!


This is Usenet, not an instant-messaging forum or a text-message. Take
time and care to ensure that your words are spelled correctly and that
proper capitalization is used (especially where class names are involved).

I would also note that the code you have given us is obviously not
complete; it is generally more important to give relevant portions of
code and highlighting where the error is.

> [ ... ]
> JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);


Are you sure that the input stream is actually a JPEG? Print it out
somewhere and see if it really is a JPEG.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Chingysuna

2007-08-27, 7:20 am

3 LESBlANS MASTURBATING THEN COMING TOGETHER
http://girls-with-girls.info/movplay.php?f=1436913
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com