Click here to Skip to main content
15,909,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every one, can somebody help with croping JPEG images into parts and saveing tgis parts on disk, without loading base image into memory? I got how to crop TIFF files and i spent a lot of time to do the same with JPEG. Please help.
Posted

I already gave you a good practically working answer, but it looks like you ignored at least a part of it: Read Big Tiff and JPEG files (>(23000 x 23000) pix) in a stream. And display part of it to the screen in realtime.[^].

Apparently, what applies to "TIFF and JPEG" is applied to "JPEG". "Without loading… in memory" sounds somewhat ridiculous. JPEG files are not designed to be partially read, just because they don't have "parts". As the data is compressed, you cannot read, say, only lower half of the image, because you don't know the boundary; a lower half may occupy, say, 70% of the file. The files are designed to be loaded fully, you cannot do anything else. Load it in memory in full. If not in memory, then where? :-)

It looks like you are coming back to the same wrong idea over and over (I don't want to repeat "elegant" biblical saying telling us like who :-)), but you need to move forward. Thing about it.

—SA
 
Share this answer
 
Comments
Mehdi Gholam 7-May-13 11:59am    
5'ed
Sergey Alexandrovich Kryukov 7-May-13 12:04pm    
Thank you, Mehdi.
—SA
Alexey Gapon 7-May-13 19:14pm    
I didnt ignore anything. I asked if there a way croping the JPEGs, course i found out how to crop TIFF files. That is all i asked here. You answered my quastion about reading JPEG. So now i understand that if the resolution is larger then 5000 * 5000 i should save it into TIFF format for my tasks. Thanks A lot for the help.
Sergey Alexandrovich Kryukov 7-May-13 19:32pm    
Look, there is not JPEG or TIFF cropping. You load either of them, get Bitmap, and do whatever you need with the bitmap. Crop is not related to the file type, it's the operation of the bitmap, not a file.
Anyway, are you accepting the answer formally (green button)?
—SA
Alexey Gapon 8-May-13 3:32am    
Actualy you a wrong because BitMiracle allows to read TIFF file withot loading file into memory.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-May-13 11:40am    
That's not it. Pay attention for these weird words: "without loading base image into memory". The root of the problem is there. Please see OP's previous questions where it is explained better and my answers.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900