The image is cached - but it isn't reused in new requests. Consider
this simple example:


<cfimage source="presentations/images/originals/insp_continuity.png"
action="resize" width="100" height="100" name="myimage">

<h2>Other Content Rocks</h2>

<cfimage action="writeToBrowser" source="#myimage#">

<cfdirectory 
directory="/Applications/ColdFusion8/tmpCache/CFFileServlet/_cf_image"
name="test">
<cfdump var="#test#">

If you (fix the path of course) reload this a few times, you will see
a new file is created everytime. I stand by my original recommendation
- in _general_, it probably makes sense to manipulate an image only
one time and save the result.

On Thu, Jun 19, 2008 at 11:14 AM, Brad Wood <[EMAIL PROTECTED]> wrote:
> There was just a thread on this last week.
> (http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56712)
> According to Jochem, ColdFusion DOES cache the file locally on the web
> server in the /WEB-INF/cfusion/tmpCache/ directory.
>
> What this means, is your image is written to the local file system of
> your ColdFusion server regardless of whether you do it, or if you use
> the write-to-browser function.  The main benefit you would have of
> writing it yourself is that you could choose where to put it-- ie, a
> central network location which is mapped as a virtual directory on your
> web server so load balancing will work without sticky sessions.
>
> Of course, the upside to using the writetobrowser is that ColdFusion
> cleans up for you, and you don't have to worry about clearing out the
> old files yourself.
>
> Heck, why don't you do the following and get the best of a couple
> worlds.  You can let ColdFusion write and clean up the file, but you can
> use it however you want:
>
> <cfimage action="read" source="D:\path\to\your\image\my_image.gif"
> name="my_image">
>
> <cfsavecontent variable="my_image_html">
>        <cfimage action="writeToBrowser" source="#my_image#">
> </cfsavecontent>
>
> <cfset image_path = rereplacenocase(my_image_html,"(<img
> )(src="")([^""]*)("".*$)","\3","one")>
>
> <table background="<cfoutput>#image_path#</cfoutput>">
>        <tr><td>My Table<br /><br /><br /><br /></td></tr>
> </table>
>
> ~Brad
>
>
> -----Original Message-----
> From: Scott Weikert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 19, 2008 9:38 AM
> To: CF-Talk
> Subject: Re: CF8, cfimage "writetobrowser" action - backgrounds?
>
> Well thinking about it MORE, I really *do* need to write the images
> right out to the browser.
>
> The sheer number of combinations of the data preclude pre-writing out
> the images to the file system - it would be a huge number of files.
>
> But I figured out my background issue. I'm just using a pair of divs,
> overlaid using z-index. One div, I toss the <cfimage> tag into - the
> other div (with a higher z-index), I do my other info overlay. Works
> like a champ. :)
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307735
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to