Alright...so now I've changed my ImageUtils.java file (code is below)
and I'm getting a bunch of "cannot resolve symbol" errors when trying to
compile it. What am I missing now??
Thanks again...chris
---------------------------------------------------------
// Java Document
import java.io.*;
import java.util.*;
import java.awt.image.renderable.*;
import javax.media.jai.*;
import com.sun.media.jai.codec.*;
public class ImageUtils
{
public void load(String file) throws IOException
{
FileSeekableStream fss = new FileSeekableStream(file);
image = JAI.create("stream", fss);
height = image.getHeight();
width = image.getWidth();
}
public void writeResult(String file, String type) throws
IOException
{
FileOutputStream os = new FileOutputStream(file);
JAI.create("encode", result, os, type, null);
}
public void thumbnail(float edgeLength)
{
boolean tall = (height > width);
float modifier = edgeLength / (float) (tall ? height : width);
ParameterBlock params = new ParameterBlock();
params.addSource(image);
params.add(modifier);//x scale factor
params.add(modifier);//y scale factor
params.add(0.0F);//x translate
params.add(0.0F);//y translate
params.add(new InterpolationNearest());//interpolation method
result = JAI.create("scale", params);
}
public void crop(float edge)
{
ParameterBlock params = new ParameterBlock();
params.addSource(image);
params.add(edge);//x origin
params.add(edge);//y origin
params.add((float) width - edge);//width
params.add((float) height - edge);//height
result = JAI.create("crop", params);
}
public void border(int edge, double edgeColor)
{
ParameterBlock params = new ParameterBlock();
params.addSource(image);
params.add(edge);//left pad
params.add(edge);//right pad
params.add(edge);//top pad
params.add(edge);//bottom pad
double fill[] = {edgeColor};
params.add(new BorderExtenderConstant(fill));//type
params.add(edgeColor);//fill color
result = JAI.create("border", params);
}
}
---------------------------------------------------------
-----Original Message-----
From: Matt Liotta [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 24, 2002 3:47 PM
To: CF-Talk
Subject: RE: Image manipulation with CFMX and JAI
Correct
Matt Liotta
President & CEO
Montara Software, Inc.
http://www.montarasoftware.com/
V: 415-577-8070
F: 415-341-8906
P: [EMAIL PROTECTED]
> -----Original Message-----
> From: Chris Kief [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 3:50 PM
> To: CF-Talk
> Subject: RE: Image manipulation with CFMX and JAI
>
> Ok...this is starting to make more sense. So the methods you listed in
> the article should go within the ImageUtils class definition:
>
> public class ImageUtils
> {
> article methods here???
> }
>
> thanks again...chris
>
>
> -----Original Message-----
> From: Matt Liotta [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 24, 2002 3:34 PM
> To: CF-Talk
> Subject: RE: Image manipulation with CFMX and JAI
>
> Oh! You need to create a Java class file that contains the code
> referenced in the article. For example...
>
> import java.io.*;
> import java.util.*;
> import java.awt.image.renderable.*;
> import javax.media.jai.*;
> import com.sun.media.jai.codec.*;
>
> public class ImageUtils
> {
>
> }
>
> Matt Liotta
> President & CEO
> Montara Software, Inc.
> http://www.montarasoftware.com/
> V: 415-577-8070
> F: 415-341-8906
> P: [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: Chris Kief [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 24, 2002 3:31 PM
> > To: CF-Talk
> > Subject: RE: Image manipulation with CFMX and JAI
> >
> > Forgive the ignorance - but how is this done??
> >
> > I'm a bit confused here though...aren't you referring to CF's JVM
> making
> > use of the JAI classes at runtime? I'm only trying to compile the
> java
> > file at this point with the javac command (which I believe doesn't
use
> > the JVM that CF uses??).
> >
> > I'm probably just going about this all wrong as I don't really know
> what
> > is doing what.
> >
> > Thanks again...chris
> >
> >
> > -----Original Message-----
> > From: Matt Liotta [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 24, 2002 3:05 PM
> > To: CF-Talk
> > Subject: RE: Image manipulation with CFMX and JAI
> >
> > You need to put the JAI jars into CF's classpath or CF's JVM won't
be
> > able to make use of the JAI classes.
> >
> > Matt Liotta
> > President & CEO
> > Montara Software, Inc.
> > http://www.montarasoftware.com/
> > V: 415-577-8070
> > F: 415-341-8906
> > P: [EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: Chris Kief [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, July 24, 2002 3:04 PM
> > > To: CF-Talk
> > > Subject: RE: Image manipulation with CFMX and JAI
> > >
> > > Downloaded/installed the J2SE SDK, then downloaded/installed the
JAI
> > > (JDK version). Didn't put the JAI jars into CF's classpath (they
> were
> > > installed here: C:\jdk1.3.1_04\jre\lib\ext\).
> > >
> > > Thanks...chris
> > >
> > >
> > > -----Original Message-----
> > > From: Matt Liotta [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, July 24, 2002 2:44 PM
> > > To: CF-Talk
> > > Subject: RE: Image manipulation with CFMX and JAI
> > >
> > > Did you download the JAI and install it on your system? Did you
put
> > the
> > > JAI jars into CF's classpath?
> > >
> > > Matt Liotta
> > > President & CEO
> > > Montara Software, Inc.
> > > http://www.montarasoftware.com/
> > > V: 415-577-8070
> > > F: 415-341-8906
> > > P: [EMAIL PROTECTED]
> > >
> > > > -----Original Message-----
> > > > From: Chris Kief [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, July 24, 2002 2:41 PM
> > > > To: CF-Talk
> > > > Subject: RE: Image manipulation with CFMX and JAI
> > > >
> > > > I'm trying to work through Matt's tutorial but I'm running into
> the
> > > > following error when trying to compile:
> > > >
> > > > ImageUtils.java:2: 'class' or 'interface' expected
> > > > Public void load(String file) throws IO Exception
> > > >
> > > > I'm guessing this has something to do with the way the JAI is
> > > > installed/configured. I tried messing with the CLASSPATH
settings
> in
> > > the
> > > > system's environment variables with no luck.
> > > >
> > > > I'm a complete newbie to Java so any help is greatly
> > > appreciated...chris
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Dave Watts [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, July 24, 2002 2:32 PM
> > > > To: CF-Talk
> > > > Subject: RE: Image manipulation with CFMX and JAI
> > > >
> > > > > > As promised, here is the article.
> > > > > >
> > > > > >
http://www.evolt.org/article/Image_Manipulation_with_CFMX_and_
> > > > > > JAI/18/33907/index.html
> > > > >
> > > > > Wow. Aticle not found... Exciting article :-)
> > > > > Got any other 404 templates to send us a link to :-)
> > > > >
> > > > > The link seems to be this now:
> > > > > http://www.evolt.org/article/Image_Manipulation_with_CFMX_and_
> > > > > JAI/18/33907/i
> > > > > ndex.html
> > > >
> > > > Uh, Matt's URL worked for me.
> > > >
> > > > Dave Watts, CTO, Fig Leaf Software
> > > > http://www.figleaf.com/
> > > > voice: (202) 797-5496
> > > > fax: (202) 797-5444
> > > >
> > > >
> > >
> > >
> >
> >
>
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists