Skip to main content
Ben Nadel at CFUNITED 2009 (Lansdowne, VA) with: Kim
Ben Nadel at CFUNITED 2009 (Lansdowne, VA) with: Kim

Reflecting Images With ImageUtils.cfc ColdFusion Image Component

By
Published in Comments (10)

I only have a few minutes before I have to do some real work, so I will keep this very brief. This morning, I added the ability to create an image reflection effect, very much like the one that was popularized by Apple and iTunes, and added it to the ImageUtils.cfc ColdFusion image manipulation component:

ReflectImage( Image, Side [, BackgroundColor, Offset, Size, StartingAlpha ] )

Of the listed arguments, the only ones that are required are Image and Side. The rest are individually optional. By default, it assumes you are working on a white background. Here is a quick example of this in action:

<!--- Read in the Subject image. --->
<cfimage
	action="read"
	source="./subject.jpg"
	name="objImage"
	/>

<!--- Create the reflection. Use black background. --->
<cfset objImage = ReflectImage(
	objImage,
	"Bottom",
	"##000000"
	) />

<!--- Draw image. --->
<cfimage
	action="writetobrowser"
	source="#objImage#"
	/>

I know this is not the best example, and doesn't even use the ImageUtils.cfc (I am in a crazy hury). Sorry. In this code, we are using a black background override (instead of the white background). The background color must be a HEX value; it will not accept RGB or named colors (at least for the time being). Running the above, we get the following output:

Subject Reflected On Black Shiney Surface

I think that looks pretty slick on a black background.

NOTE: The method does not create the black border around the image. I only included that for a better visual.

As I was building this, I realized that my functions are not consistent on which methods return a NEW image and which methods update the original image. I think that I want to go back and make them all NON-destructive effects. Meaning, I want them to always return a new image and leave the original image unaltered. This way, the ImageUtils.cfc will behave very predictably.

And, very quickly, if you want to see how this function is actually working, here is the code. The actual code that is inside of the ImageUtils.cfc is ever so slightly different, but this gives you the idea:

<cffunction
	name="ReflectImage"
	access="public"
	returntype="any"
	output="false"
	hint="Reflects image along the given side with the given properties.">

	<!--- Define arguments. --->
	<cfargument
		name="Image"
		type="any"
		required="true"
		hint="The ColdFusion image object that we are going to reflect."
		/>

	<cfargument
		name="Side"
		type="string"
		required="true"
		hint="The side of the image that we are going to reflect. Valid values include Top, Right, Bottom, and Left."
		/>

	<cfargument
		name="BackgroundColor"
		type="string"
		required="false"
		default="FFFFFF"
		hint="The HEX color of the canvas background color used in the reflection."
		/>

	<cfargument
		name="Offset"
		type="numeric"
		required="false"
		default="0"
		hint="The offset of the reflection from the image."
		/>

	<cfargument
		name="Size"
		type="numeric"
		required="false"
		default="100"
		hint="The height or width of the given reflection (depending on the side being reflected)."
		/>

	<cfargument
		name="StartingAlpha"
		type="numeric"
		required="false"
		default="25"
		hint="The starting alpha channel of the covering !!background color!! (between 0 and 255 where 0 is completely transparent)."
		/>

	<!--- Set up local scope. --->
	<cfset var LOCAL = {} />


	<!--- Check to make sure that we have a valid side. --->
	<cfif NOT ListFindNoCase( "Top,Right,Bottom,Left", ARGUMENTS.Side )>

		<!---
			An invalid side was passed in, so just default
			to the most popular: bottom.
		--->
		<cfset ARGUMENTS.Side = "Bottom" />

	</cfif>


	<!---
		Before we apply the reflection, we have to figure
		out what the size of our resulting canvas will be.
		This is going to be different depending on what side
		we are refelcting.
	--->
	<cfif ListFindNoCase( "Top,Bottom", ARGUMENTS.Side )>

		<!--- We are reflecting in the vertical plane. --->

		<!---
			Get the size of the resultant canvas. This will be
			the same width, but will need to take into account
			the size and offset of the reflection.
		--->
		<cfset LOCAL.Width = ImageGetWidth( ARGUMENTS.Image ) />

		<cfset LOCAL.Height = (
			ImageGetHeight( ARGUMENTS.Image ) +
			ARGUMENTS.Offset +
			ARGUMENTS.Size
			) />

	<cfelse>

		<!--- We are reflecting in the horizontal plane. --->

		<!---
			Get the size of the resultant canvas. This will be
			the same height, but will need to take into account
			the size and offset of the reflection.
		--->
		<cfset LOCAL.Height = ImageGetHeight( ARGUMENTS.Image ) />

		<cfset LOCAL.Width = (
			ImageGetWidth( ARGUMENTS.Image ) +
			ARGUMENTS.Offset +
			ARGUMENTS.Size
			) />

	</cfif>


	<!---
		Create the new canvas with the above calculated
		dimensions. Leave the background transparent in
		case the user wants to use the reflection over
		something else.
	--->
	<cfset LOCAL.Result = ImageNew(
		"",
		LOCAL.Width,
		LOCAL.Height,
		"argb"
		) />


	<!---
		Create a copy of the passed in image. We are going
		to be building our reflection gradient over this image.
	--->
	<cfset LOCAL.Reflection = ImageCopy(
		ARGUMENTS.Image,
		0,
		0,
		ImageGetWidth( ARGUMENTS.Image ),
		ImageGetHeight( ARGUMENTS.Image )
		) />

	<!---
		Now, we actually need to flip the image that we are
		going to reflect. This will be either veritcal or
		horizontal depending on the side.
	--->
	<cfif ListFindNoCase( "Top,Bottom", ARGUMENTS.Side )>

		<!--- Flip vertical. --->
		<cfset ImageFlip( LOCAL.Reflection, "vertical" ) />

	<cfelse>

		<!--- Flip horizontal. --->
		<cfset ImageFlip( LOCAL.Reflection, "horizontal" ) />

	</cfif>


	<!---
		Get the colors that will be used in the gradient.
		These will both be the same color, but with different
		alpha channels.
	--->
	<cfset LOCAL.FromColor = HexToRGB( ARGUMENTS.BackgroundColor ) />
	<cfset LOCAL.ToColor = StructCopy( LOCAL.FromColor ) />

	<!---
		The from color will have the given starting alpha and
		the to color will always have an alpha of 255 which will
		give us a solid background.
	--->
	<cfset LOCAL.FromColor.Alpha = ARGUMENTS.StartingAlpha />
	<cfset LOCAL.ToColor.Alpha = 255 />


	<!---
		Now that we have our reflection image, we have to figure
		out how we want to build the fade-to-background color
		gradient. This is going to be dependent on what side is
		being reflected.

		Once we have that, let's create the new image by pasting
		both the original image and the reflection image onto
		the new canvas.
	--->
	<cfswitch expression="#ARGUMENTS.Side#">

		<cfcase value="Top">

			<!--- Create reflection w/ Gradient. --->
			<cfset LOCAL.Reflection = DrawGradientRect(
				LOCAL.Reflection,
				0,
				(ImageGetHeight( LOCAL.Reflection ) - ARGUMENTS.Size),
				ImageGetWidth( LOCAL.Reflection ),
				ARGUMENTS.Size,
				LOCAL.FromColor,
				LOCAL.ToColor,
				"BottomTop"
				) />

			<!--- Paste original object onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				ARGUMENTS.Image,
				0,
				(ImageGetHeight( LOCAL.Result ) - ImageGetHeight( ARGUMENTS.Image ))
				) />

			<!--- Paste reflection onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				LOCAL.Reflection,
				0,
				(-ImageGetHeight( LOCAL.Reflection ) + ARGUMENTS.Size)
				) />

		</cfcase>

		<cfcase value="Bottom">

			<!--- Create reflection w/ Gradient. --->
			<cfset LOCAL.Reflection = DrawGradientRect(
				LOCAL.Reflection,
				0,
				0,
				ImageGetWidth( LOCAL.Reflection ),
				ARGUMENTS.Size,
				LOCAL.FromColor,
				LOCAL.ToColor,
				"TopBottom"
				) />

			<!--- Paste original object onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				ARGUMENTS.Image,
				0,
				0
				) />

			<!--- Paste reflection onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				LOCAL.Reflection,
				0,
				(ImageGetHeight( ARGUMENTS.Image ) + ARGUMENTS.Offset)
				) />

		</cfcase>

		<cfcase value="Left">

			<!--- Create reflection w/ Gradient. --->
			<cfset LOCAL.Reflection = DrawGradientRect(
				LOCAL.Reflection,
				(ImageGetWidth( LOCAL.Reflection ) - ARGUMENTS.Size),
				0,
				ARGUMENTS.Size,
				ImageGetHeight( LOCAL.Reflection ),
				LOCAL.FromColor,
				LOCAL.ToColor,
				"RightLeft"
				) />

			<!--- Paste original object onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				ARGUMENTS.Image,
				(ImageGetWidth( LOCAL.Result ) - ImageGetWidth( ARGUMENTS.Image )),
				0
				) />

			<!--- Paste reflection onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				LOCAL.Reflection,
				(-ImageGetWidth( LOCAL.Reflection ) + ARGUMENTS.Size),
				0
				) />

		</cfcase>

		<cfcase value="Right">

			<!--- Create reflection w/ Gradient. --->
			<cfset LOCAL.Reflection = DrawGradientRect(
				LOCAL.Reflection,
				0,
				0,
				ARGUMENTS.Size,
				ImageGetHeight( LOCAL.Reflection ),
				LOCAL.FromColor,
				LOCAL.ToColor,
				"LeftRight"
				) />

			<!--- Paste original object onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				ARGUMENTS.Image,
				0,
				0
				) />

			<!--- Paste reflection onto canvas. --->
			<cfset ImagePaste(
				LOCAL.Result,
				LOCAL.Reflection,
				(ImageGetWidth( ARGUMENTS.Image ) + ARGUMENTS.Offset),
				0
				) />

		</cfcase>

	</cfswitch>


	<!---
		We have created the reflection. Now, return the
		resulting canvas.
	--->
	<cfreturn LOCAL.Result />
</cffunction>

Want to use code from this post? Check out the license.

Reader Comments

357 Comments

To be clear, Todd, it wasn't my, or Ben's, intention to put anyone out of business. As a 'personal' project, there is only so much we can do on the support side versus a commercial company. That right there gives a commercial product an advantage over our solution.

218 Comments

Yup, me too.

I have a stupid ajaxproxy issue that I'm racking my head on if any of you want to peek at it and point out what I'm doing wrong. I saw code elsewhere that says it should be working, but my code says it's not. :(

1 Comments

Hi Ben. Although your imageutils.cfc is a very nice Custom tag but it have some issues, i was just trying this and got error:

certainly after a long work, i just again got into trouble with this imageutils.cfc Tag. well it is working on my localhost, i do not why. i contacted my host and they said they are not blocking any java stuff to get this tag from being executed.

When i crop Image and watermark and make a shadow. it shows java error i use the following code to work and recieve error: My Host says it is a Bug. They said they have also applied the latest Coldfusion cfimage patch. So what are your views about this.

I have following code which generates error

<cffile accept="image/jpg,image/pjpeg,image/jpeg" action="upload" destination="#request.file_path#\pictures" filefield="uploadimage"
nameconflict="overwrite">
<cfset inpoint = "#cffile.ServerFile#">
<cfset form.inpoint = "#inpoint#">
<cfset imageutils = createObject("component", "#request.cfcPath#.imageUtils")>
<cfset pic = imageread("pictures/#inpoint#")>
<cfset newpoint= ImageNew(pic)>
<cfset aspect = imageutils.aspectCrop(newpoint,form.t2,form.t1,form.position)>
<cfif form.watermark EQ 'yes'>
<cfset objWatermark = ImageNew("pictures/watermark.png")/>
<cfset ImageSetAntialiasing(aspect,"on") />
<cfset ImageSetDrawingTransparency(aspect,50) />
<cfset ImagePaste(aspect,objWatermark,(aspect.GetWidth() - objWatermark.GetWidth()),(aspect.GetHeight() - objWatermark.GetHeight())) />
</cfif>
<cfif form.shadow EQ 'yes'>
<cfset objImage = imageutils.makeShadow(aspect,5, 5)>
</cfif>
<cfif form.shadow EQ 'yes'>
<cfset abytes = objImage.getImageBytes("jpg")>
<cfelseif form.watermark is 'yes'>
<cfset abytes = aspect.getImageBytes("jpg")>
<cfelse>
<cfset abytes = aspect.getImageBytes("jpg")>
</cfif>
<cfscript>
FileWrite("#request.file_path#pictures\#inpoint#", "#abytes#");
</cfscript>
</cfif>

Error:

500

ROOT CAUSE:
java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI
at coldfusion.image.Image.crop(Image.java:906)
at coldfusion.runtime.CFPage.ImageCrop(CFPage.java:5925)
at cfimageUtils2ecfc490838651$funcASPECTCROP.runFunction(E:\domains\mywebsite.com\wwwroot\corecontrol\cfc\imageUtils.cfc:93)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at cfmakeourpages2ecfm521544774._factor1(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:58)
at cfmakeourpages2ecfm521544774._factor2(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:50)
at cfmakeourpages2ecfm521544774._factor3(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:47)
at cfmakeourpages2ecfm521544774._factor5(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:43)
at cfmakeourpages2ecfm521544774._factor16(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:32)
at cfmakeourpages2ecfm521544774.runPage(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfpage2ecfm1013917632.runPage(E:\domains\mywebsite.com\wwwroot\corecontrol\page.cfm:28)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfindex2ecfm250979878.runPage(E:\domains\mywebsite.com\wwwroot\corecontrol\index.cfm:98)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:273)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


javax.servlet.ServletException: ROOT CAUSE:
java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI
at coldfusion.image.Image.crop(Image.java:906)
at coldfusion.runtime.CFPage.ImageCrop(CFPage.java:5925)
at cfimageUtils2ecfc490838651$funcASPECTCROP.runFunction(E:\domains\mywebsite.com\wwwroot\corecontrol\cfc\imageUtils.cfc:93)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at cfmakeourpages2ecfm521544774._factor1(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:58)
at cfmakeourpages2ecfm521544774._factor2(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:50)
at cfmakeourpages2ecfm521544774._factor3(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:47)
at cfmakeourpages2ecfm521544774._factor5(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:43)
at cfmakeourpages2ecfm521544774._factor16(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:32)
at cfmakeourpages2ecfm521544774.runPage(E:\domains\mywebsite.com\wwwroot\corecontrol\makeourpages.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfpage2ecfm1013917632.runPage(E:\domains\mywebsite.com\wwwroot\corecontrol\page.cfm:28)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661)
at cfindex2ecfm250979878.runPage(E:\domains\mywebsite.com\wwwroot\corecontrol\index.cfm:98)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:273)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

357 Comments

Gavy, not to speak for Ben, but I would not recommend using a blog comment as a place to post large stack traces. ImageUtils has a bug tracker at RIAForge: http://imageutils.riaforge.org/index.cfm?event=page.issues

Can you log the issue there?

Also, I'd recommend simplifying the code as much as possible. You said it worked ok locally but not on your host. That seems to imply a host issue, even though they deny it, but if you can get it down to one particular line that causes an error, it will be easier to test.

2 Comments

Hi Ben,
nice component, i use it very often and realy like it. Now i have a little problem. I need to create reflections without background. The page, displaying the images has a textured background and a background color within the reflection would look ugly :( Any hint for me? Thanks in advance.

Best regards
Patrick

15,848 Comments

@Patrick,

You'd have to create the images with an alpha channel. I don't remember the specifics off-hand. If I can carve out some time, I'll try to look into it, but with CF9 out, I'm really putting a lot of time into exploring that.

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel