ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 5th, 2005, 01:01 AM
prs_kishore prs_kishore is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 23 prs_kishore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 5 sec
Reputation Power: 0
calling java class (with JMagick code) from CFML MX

Hi,

I have previously developed applications in CFML calling java
classes using "<cfset createobject>".

Now I have developed a Java application with JMagick and
ImageMagick support.
ImageMagick is a free open source Image Manipulation libraries collection.
JMagick is a JNI (Java Native Interface) provided over
ImageMagick. By installing ImageMagick and Jmagick, I was
able to develop a Java application successfully.

Now, I need to call this JAVA class from CFML, so that I
can develop a CFML application for Image Processing.

This is my java class;
import magick.ImageInfo;
import magick.MagickImage;
import magick.MagickException;
public class imtrail
{
public String execute(String filename,int x,int y)
{
String message = "";
ImageInfo info = null;
MagickImage image1 = null;
try
{
info = new ImageInfo(filename);
image1 = new MagickImage(info);
MagickImage bigger = image1.scaleImage(x,y);
bigger.setFileName(filename);
bigger.writeImage(info);
}
catch(MagickException e)
{
message = e.getMessage();
}
return message;
}
}

This is my CFML code:
<cfset file_name = "c:\\images\\fujifilm.jpg">
<cfset x = 150>
<cfset y = 150>
<cfset myobject = createobject("java","imtrail")>
<cfset message = myobject.execute(file_name,x,y)>
<cfoutput>#message#</cfoutput>

I am getting the error:
Object Instantiation Exception.
An exception occurred when instantiating a java object. The cause of this exception was that: magick/MagickException.

The error occurred in C:\cfmltest\scale.cfm: line 4

2 : <cfset x = 150>
3 : <cfset y = 150>
4 : <cfset myobject = createobject("java","imtrail")>
5 : <cfset message = myobject.execute(file_name,x,y)>
6 : <cfoutput>#message#</cfoutput>

If any one has any idea please help me

Thank you in advance
Kishore PRS.

Reply With Quote
  #2  
Old April 15th, 2005, 03:24 PM
buzzy buzzy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 buzzy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 28 sec
Reputation Power: 0
One way to make it work...

We have run into the same problem on our sites. We make extensive use of Jmagick/ImageMagick.

I found that if you place the jmagick.jar file in the server path that the jmagick/imagemagick app will run correctly. The server path is typically C:\CFusionMX7\runtime\servers\lib on a typical server installation.

I have also noticed that this problem does not present itself in a j2ee install. Think that is because all java objects are loaded from the j2ee class.

Reply With Quote
  #3  
Old June 7th, 2005, 09:36 AM
gemma_cat gemma_cat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 gemma_cat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 11 sec
Reputation Power: 0
Arrow help

Quote:
Originally Posted by buzzy
We have run into the same problem on our sites. We make extensive use of Jmagick/ImageMagick.

I found that if you place the jmagick.jar file in the server path that the jmagick/imagemagick app will run correctly. The server path is typically C:\CFusionMX7\runtime\servers\lib on a typical server installation.

I have also noticed that this problem does not present itself in a j2ee install. Think that is because all java objects are loaded from the j2ee class.



Hi, I am a beginner using JMagic/ImageMagick on Coldfusion MX.. and struggling on intalling it properly on server. I got 'jmagick.dll' file downloaded from their official website. How does it work to generate 'jmagic.jar' file? . do I only need to include this file on path (configured on coldfusion MX adminstrator) setting ? Is there any other website userful in terms of instructing beginner people like me to install, configure and start using it ?

Thanks a lot, and eagerly waiting for your answer.


Cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > calling java class (with JMagick code) from CFML MX


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT