Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfimage supported types

New Here ,
Feb 09, 2010 Feb 09, 2010

I've run into a puzzle using cfimage trying to manipulate .JPG images.  Certain files work on Machine A but not Machine B. (Exception being "Unsupported Image Type".)

GetReadableImageFormats() returns 15 formats on Machine A, only 12 on Machine B.  The missing filetypes are:

  • JFIF
  • JPEG-LOSSLESS
  • JPEG-LS

Both machines are running CF9 Standard.  Machine A is 32-bit, Machine B is 64-bit.

I guess I'm wondering if something can be tweaked on Machine B to enable support for these file types.  Any ideas?

1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 09, 2010 Feb 09, 2010

Well I'm still curious about the supported image types, but I was able to run around the issue using Java.  It reads the image CF didn't like and converts it from CMYK to RGB before creating a CF image object.

<cfscript>

/* init JAI, read file */

JAI = createObject("Java","javax.media.jai.JAI");

img = JAI.create("fileload","#this.filepath#\uploads\#local.filename#");

/* init colorspace to convert to RGB */

model = img.getColorModel();

space = model.getColorSpace();

rCS = createObject("java","java.awt.color.ColorSpace").CS_sRGB;

rgb = createObject("java","java.awt.color.ColorSpace").getInstance(rCS);

convert = createObject("java","java.awt.image.ColorConvertOp").init(rgb,javaCast("null",""));

//convert JAI to normal Java buffered img

bImg = img.getAsBufferedImage();

rgbImg = convert.filter(bImg,javaCast("null",""));

/* back to CF */

newImg = ImageNew(rgbImg);

// strangely, JAI seems to have created a negative image

imageNegative(newImg);

</cfscript>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 12, 2010 Feb 12, 2010
LATEST

I would presume it's the JVM rev level that dictates this.  Are they different on each server?  I presume a given rev level of JVM is functionally equivalent irrespective of being 32- and 64-bit implementations?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources