JAI platform indipendent on MAC osx
I develop an application with JAI that from a big image (about 500MB size) outputs 2 JPEG images, one 1900x1200 and other 320x320. The source image can be TIFF, JPEG, GIF, BMP, PNG, with alpha or not.
I didn't install anything in JVM, I only added jai_core.jar and jai_codec.jar to my application.
With this context (I don't know if it is a correct context) I found some problems that I will try to explain:
- SubsampleAverage works better than Scale, but is not good like scaling with standard java BufferedImage.
- After subsampling crop doesn't work well, if I have a subsampled image of 420x320size and I want to crop to 60,0,320,320 it outputs me a blank rect from 0 to 59px; in detail a get PlanarImage from JAI.create("SubsampleAverage") then I use it for crop and It gives me this problem.
- Only on MAC OSX (Linux doesn't give this problem): TIFF PlanarImage ColorSpace are seen as RGB and not CMYK. Linux see the same image as CMYK.
This problem born because I need to trasform CMYK images to 3 band RGB images (for storing inside a JPEG image). If I force the transform on a CMYK image that is seen as RGB it works well, but I need to know if it is a CMYK or RGB because I can import an RGB image with alpha and I dont' want to convert it.
I try also to add to put "com.sun.media.jai.disableMediaLib" as "true" but with no changes.
Thank you very much.