I need a DLL, or .NET code without an exe file, to make a progressive lossless jpeg (.jpg, not JPEG 2000 or JPEG-LS that are not supported in several browsers) because I'm using a shared hosting where I can't execute .exe files. I'm using freeImage which is supposed to do it but it doesn't produce a lossless jpeg (I have obtained a progressive one).
This is my freeImage code:
image = FreeImage.Load(FREE_IMAGE_FORMAT.FIF_JPEG, inputPath, FREE_IMAGE_LOAD_FLAGS.JPEG_ACCURATE)
FreeImage.Save(FREE_IMAGE_FORMAT.FIF_JPEG, image, outputPath, FREE_IMAGE_SAVE_FLAGS.JPEG_OPTIMIZE Or FREE_IMAGE_SAVE_FLAGS.JPEG_PROGRESSIVE)
It's supposed that the FREE_IMAGE_SAVE_FLAGS.JPEG_OPTIMIZE flag makes the image lossless, but it doesn't work. Am I doing something wrong?
With an exe file, I could solve the problem using jpegtran. To get a lossless progressive jpeg, you only need to execute a shell command from your .NET app or Web.
If you execute this command:
jpegtran -copy none -optimize -progressive inputPath.jpg outputPath.jpg
You'll get a progressive lossless jpeg file
I have used it and it works, but I need to do it without an exe file.