Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Code Block
title"resizeImages.cfm"

<cfsetting requesttimeout="10000000">
	
<cfset oImageFormTool=createObject("component", "farcry.core.packages.formtools.image") />
<cfquery name="qImages" datasource="#application.dsn#">
	SELECT * FROM
	dmImage where sourceImage != '' and status='approved'
</cfquery>

<cfloop query="qImages" >
	<cfscript >
		stargs=structnew();
		stargs.source="#application.path.imageRoot#/#qImages.sourceImage#";
		stargs.destination="#application.path.imageRoot#/#application.stCoapi.dmImage.stProps.ThumbnailImage.METADATA.ftdestination#";
		stargs.width=  application.stCoapi.dmImage.stProps.ThumbnailImage.METADATA.ftimagewidth;
		stargs.height=application.stCoapi.dmImage.stProps.ThumbnailImage.METADATA.FTIMAGEHEIGHT;
		stargs.interpolation=application.stCoapi.dmImage.stProps.ThumbnailImage.METADATA.ftinterpolation;
		stargs.resizeMethod=application.stCoapi.dmImage.stProps.ThumbnailImage.METADATA.FTAUTOGENERATETYPE;

		streturn=oImageFormTool.generateImage(argumentCollection=stargs);

		stargs=structnew();
		stargs.source="#application.path.imageRoot#/#qImages.sourceImage#";
		stargs.destination="#application.path.imageRoot#/#application.stCoapi.dmImage.stProps.standardImage.METADATA.ftdestination#";
		stargs.width=  application.stCoapi.dmImage.stProps.standardImage.METADATA.ftimagewidth;
		stargs.interpolation=application.stCoapi.dmImage.stProps.standardImage.METADATA.ftinterpolation;
		stargs.resizeMethod=application.stCoapi.dmImage.stProps.standardImage.METADATA.FTAUTOGENERATETYPE;

		streturn=oImageFormTool.generateImage(argumentCollection=stargs);
	</cfscript>

	<cfoutput>
		#qImages.title# done.. <br/>
		<cfflush  />
	</cfoutput>
</cfloop>

</cfsetting>