Not the answer you are looking for, I think, but ...
To perform image processing using JPEG files as input, you need to decode the images. Well, actually, 90/180/270 degrees rotation, turning and cropping is possible in the form of lossless operations and, thus, without decoding image data. But for something more advanced, such as resizing, you need to work with a decoded image.
Both the file structure (JIF / JFIF) and the algorithms used to compress image data in the standard JPEG format are well defined and well documented. But at the same time, the specification is rather complicated. This is certainly possible if you have the time and you know what you are doing. And if you're lucky and your JPEG drops are written the same way, you can get away from implementing only some of the specifications. But even then you will need to (re) implement large parts of the specification, and it might just not be worth it.
Using a third-party service to convert it or creating your own library using a well-known library such as libjpeg or Java ImageIO, etc., may be your best bet if you need a quick solution and donβt need too strict performance requirements.
source share