Categories: Cold Fusion

Image Manipulation in Coldfusion MX 6.1 – Issues and Workarounds

Hello readers.

Today I am going to post a quick but detailed overview of the job which I was onto since a couple of days. As it’s pretty obvious from the title that I am going to write some thing about image handling and manipulation in a coldfusion application. But very first I want to mention that as most of you would have knowledge that CF8 and CF9 do have built-in tag for image manipulation. Here I’ll not talk about CF8 or CF9 functionalities but I would do about CFMX6.x because the main purpose for third party image manipulation resources would really ease in the earlier versions of Coldfusion which never had a built-in support for image manipulation.

So the brief is that I had found and used a couple of third party tags for image manipulation on CFMX6.1. They all worked good. I am talking about tags, both the ones developed with C++ and the other ones developed with Java. But they were only good until I have to put them to manipulate BMP images…. Huh!!!! They all just refused to manipulate the images of format BMP. I got again to search some others, I did find as well. But again they didn’t work good with BMP Images unless I tested them on later versions of Coldfusion. Specifying this statement that they worked on later versions of Coldfusion but not on CFMX6.1.

I’ll just get to point that why it caused the issues on CFMX6.1 and how to work around it. But before, I would mention that the workaround will be good till you use an Image Manipulation custom tag, component or a library which are built with Java Native APIs. This will not fix the issue with the tags built with C++.

With Java, the issue is caused due to the earlier versions of JRE (Java Runtime Environment) on which the earlier versions of Coldfusions were relying. As CFMX6.1 was initially on JRE 1.4.2 and unfortunately JRE 1.4.2 was not supporting BMP plug-ins. SUN started to put built-in support for more formats of images in later versions of Java. But fortunately SUN started the project JAI (Java Advanced Imaging) also to support the earlier versions of Java which were not optimized fully with image manipulation. And they do release the JAI Libraries to add in your earlier versions of Java.

But specifically for our purpose here we don’t need the whole APIs but only the “JAI-ImageIO” (download links at bottom). You just need to download the libraries and add into your CFMX6.1’s run-time directory as follows.

%COLDFUSION_INSTALL_DIRECTORY%\runtime\lib\jai_imageio.jar

“jai_imageio.jar” is the jar file which should be found in the downloaded archive and you have to place in the directory as showed above. You will surely need to restart the Coldfusion Application service. And done! your tag or component(built to work with Java APIs) should work good now with almost all types of images.

Additionally for my basic requirement of resizing specifically BMP image files or any other image, I did make my own CF Component with a re-size functionality which directly uses Java APIs to get the job done. I also wrote a custom tag to make it more developer friendly. I named it the “JImage” (in which J stands for Java). The tag actually works with the component inside. But you can work with the tag or with the component depending on your ease of use.

I really hope this post will be use full and I’ll welcome your comments and feedback on this.

Thank you for reading.

References
JImage Tag/Component (downloadonline demo)
JavaTM Advanced Imaging Image I/O Tools Binary Builds (https://jai-imageio.dev.java.net/binary-builds.html)

Khurram Ali

Founder at Tech Prolonged Software Engineer by profession - Independent Tech/Gadget Blogger. Writes and reviews at Tech Prolonged for new gadgets/smartphones. @Twitter Facebook Google Plus

View Comments

Recent Posts

Starlink Internet in Pakistan – What’s the Status and Possible Pricing

In an exciting development for Pakistan’s tech landscape, SpaceX’s revolutionary satellite internet service, Starlink, could…

4 months ago

Google Wallet Launching in Pakistan This January

In an exciting development for digital payment enthusiasts, Google has announced the expansion of its…

4 months ago

Beme Unveils the Beme Nomad Boost: A Revolutionary 4-in-1 Powerbank

Beme, a pioneering tech brand, is thrilled to introduce its latest innovation, the Beme Nomad…

10 months ago

With Presto, Apple can now update box-packed iPhone to latest iOS version in Stores

Apple is gearing up for the highly anticipated launch of the iPhone 16 lineup later…

1 year ago

OPPO Unveils the Reno11 Series 5G in Pakistan – Price and Detail Inside

OPPO, known for its innovation in smart devices, has announced the launch of its high-end…

1 year ago

Vivo Y03 launched in Pakistan – Check Price and Detail

Vivo, a leading global smartphone brand, has unveiled its latest addition to the Y Series…

1 year ago