Unfortunately I said that before I found out you weren't using CF8. I haven't used it much, but if you're on MX7 try ImageUtil.cfc http://imageutils.riaforge.org/
<cfset filename = "form.file" & #i#>
<cfif evaluate(variables.filename) neq "">
I'm not sure where you got that code from but a lot of it's not recommended. For example, don't use evaluate. for dynamic variables just use:
<cfif form["form.file" & i] ... >
- don't overuse # signs. a lot of those # signs aren't necessary <cfset message = message & ",File%20#i#%20(#file.serverfile#)%20was%20uploaded">
- don't use the FILE scope. it was deprecated years ago. Also no need to manually url escape values. Just use the URLEncodedFormat function
_agx_
Unfortunately I said that before I found out you weren't using CF8
In other words, ImageResize (and a lot of other functions) won't be available to you if you're using MX7 (are you ...?) If you're on MX7 or earlier, try one of these instead
I download the zip files but I would I used it on my project?
lulu50
ASKER
brijeshchauhan:
Can you please walk me through the installation
So, a short summary what to do…
1. Install the tag and all the other files to some directory
(I can do this)
2. set a system enviroment variable CFX_OPENIMAGE_FULLPATH with value of full
pathname to the installation folder
(I am not sure how to set the variable enviroment)
3. register the dll to Cold Fusion via CF admin page
(I am not sure how to register dll to cold fusion)
4. Try out the samples
(where is the sample that I can try I don't see them?)
3. register the dll to Cold Fusion via CF admin page
=====
GO to CF Administrator, look for EXTENSIONS on your left hand pannel, then click on CFX TAGS
Extensions > CFX Tags
On This page, click on Register C++ CFX tag
Then Enter the following
Tag Name -> CFX_OPENIMAGE
Server Library -> C:\cfx_openimage\cfx_openimage.dll
Then click Submit.
2. set a system enviroment variable CFX_OPENIMAGE_FULLPATH with value of full
pathname to the installation folder
(I am not sure how to set the variable enviroment)
===============
Right Click on My Computer -> Properties -> Advanced -> Enviroment Variables
Here you can add the EV
Brijesh Chauhan
Refer this screen shot for setting Enviroment Variable above
You can use any of those 3 cfc's with MX7. You don't need to register anything. Just copy the files into your web root and it's ready to use. Resizing:
http://www.opensourcecf.com/imagecfc/docs/resize.cfm
<cfset imageCFC = createObject("component","image")>
<cfset imgInfo = imageCFC.resize("", "C:\Inetpub\wwwroot\myimage.jpg", "C:\Inetpub\wwwroot\myimage2.jpg",100,200)>
<img src="myimage2.jpg" width="100" height="200" alt="resized image to a specific width and height."/>
Installing the TAG is very easy and will NOT take you more than a couple of minutes. Also it's a very powerfull TAG written in C++, you can use it for doing LOT of Image Manupulations and functions, please read the TAG guid which is there in documentation folder...
_agx_
@lulu50 - you have the options. rather than drowning you out in a flurry of posts ;-) I'll leave it up to you to choose whichever one suits you best.
I have used this on a LINUX box as CFX OPENIMAGE is not supported on LINUX, and IMAGE CFC worked really well and infact for us on that particular project, it performed better than the inbuild cfimage tag (FOR CF 8) which used to CRASH a lot while resizing.
_agx_
Personally I prefer alagad's. But for basic resizing they're all fine. Time for me to sleep. I'm sure brij will have more to say on it, lol. So you guys continue on without me. Night all!
lulu50
ASKER
agx_:
I like to use alagad's because it is simple. but I have an error that says:
It is looking for the component. where can I get this component?
Could not find the ColdFusion Component Image.
Please check that the given name is correct and that the component exists.
You have to specify the complete page RELATIVE to web-root, say you have installed the tag in a directory called /webroot/alagad/Image.cfc, then you have to create object like
<cfset filename = "form.file" & #i#>
<cfif evaluate(variables.filenam
I'm not sure where you got that code from but a lot of it's not recommended. For example, don't use evaluate. for dynamic variables just use:
<cfif form["form.file" & i] ... >
- don't overuse # signs. a lot of those # signs aren't necessary
<cfset message = message & ",File%20#i#%20(#file.serv
- don't use the FILE scope. it was deprecated years ago. Also no need to manually url escape values. Just use the URLEncodedFormat function