<commit_before><cfapplication name='__RAILO_STATIC_CONTENT' sessionmanagement='#false#' clientmanagement='#false#' 
				applicationtimeout='#createtimespan( 1, 0, 0, 0 )#'>
	
	<cfsetting showdebugoutput="no">
	<cfparam name="url.width" default="80">
	<cfparam name="url.height" default="40">
	<cfset url.img=trim(url.img)>
	<cfset id=hash(url.img&"-"&url.width&"-"&url.height)>
	<cfset mimetypes={png:'png',gif:'gif',jpg:'jpeg'}>
	
	<cfif len(url.img) ==0>
		<cfset ext="gif"><!--- using tp.gif in that case --->
	<cfelse>
	    <cfset ext=listLast(url.img,'.')>
	</cfif>
		
	<cfheader name='Expires' value='#getHttpTimeString( now() + 100 )#'>
	<cfheader name='Cache-Control' value='max-age=#86400 * 100#'>	
	<cfset etag=hash(id)>	
	<cfheader name='ETag' value='#etag#'>

	<!--- etag matches, return 304 !--->
	<cfif len( CGI.HTTP_IF_NONE_MATCH ) && ( CGI.HTTP_IF_NONE_MATCH == '#etag#' )>
		<cfheader statuscode='304' statustext='Not Modified'>
		<cfcontent reset='#true#' type='#mimetypes[ext]#'><cfabort>
	</cfif>

	<!--- copy and shrink to local dir --->
	<cfset tmpfile=expandPath("{temp-directory}/admin-ext-thumbnails/"&id&"."&ext)>	
	<cfif fileExists(tmpfile)>
		<cffile action="readbinary" file="#tmpfile#" variable="data">
	<cfelseif len(url.img) ==0>
		<cfset data=toBinary("R0lGODlhMQApAIAAAGZmZgAAACH5BAEAAAAALAAAAAAxACkAAAIshI+<KEY>)>
		
	<cfelse>
		<cffile action="readbinary" file="#url.img#" variable="data">
		<cfimage action="read" source="#data#" name="img">
		
		<!--- shrink images if needed --->
		<cfif img.height GT url.height or img.width GT url.width>
			<cfif img.height GT url.height >
				<cfimage action="resize" source="#img#" height="#url.height#" name="img">
			</cfif>
			<cfif img.width GT url.width>
				<cfimage action="resize" source="#img#" width="#url.width#" name="img">
			</cfif>
			<cfset data=toBinary(img)>
		</cfif>
		
		<cftry>
			<cffile action="write" file="#tmpfile#" output="#data#" strict="false"><commit_msg>make shure parent path for extension thumbnails are created<commit_after><cfapplication name='__RAILO_STATIC_CONTENT' sessionmanagement='#false#' clientmanagement='#false#' 
				applicationtimeout='#createtimespan( 1, 0, 0, 0 )#'>
	
	<cfsetting showdebugoutput="no">
	<cfparam name="url.width" default="80">
	<cfparam name="url.height" default="40">
	<cfset url.img=trim(url.img)>
	<cfset id=hash(url.img&"-"&url.width&"-"&url.height)>
	<cfset mimetypes={png:'png',gif:'gif',jpg:'jpeg'}>
	
	<cfif len(url.img) ==0>
		<cfset ext="gif"><!--- using tp.gif in that case --->
	<cfelse>
	    <cfset ext=listLast(url.img,'.')>
	</cfif>
		
	<cfheader name='Expires' value='#getHttpTimeString( now() + 100 )#'>
	<cfheader name='Cache-Control' value='max-age=#86400 * 100#'>	
	<cfset etag=hash(id)>	
	<cfheader name='ETag' value='#etag#'>

	<!--- etag matches, return 304 !--->
	<cfif len( CGI.HTTP_IF_NONE_MATCH ) && ( CGI.HTTP_IF_NONE_MATCH == '#etag#' )>
		<cfheader statuscode='304' statustext='Not Modified'>
		<cfcontent reset='#true#' type='#mimetypes[ext]#'><cfabort>
	</cfif>

	<!--- copy and shrink to local dir --->
	<cfset tmpfile=expandPath("{temp-directory}/admin-ext-thumbnails/"&id&"."&ext)>	
	<cfif fileExists(tmpfile)>
		<cffile action="readbinary" file="#tmpfile#" variable="data">
	<cfelseif len(url.img) ==0>
		<cfset data=toBinary("R0lGODlhMQApAIAAAGZmZgAAACH5BAEAAAAALAAAAAA<KEY>)>
		
	<cfelse>
		<cffile action="readbinary" file="#url.img#" variable="data">
		<cfimage action="read" source="#data#" name="img">
		
		<!--- shrink images if needed --->
		<cfif img.height GT url.height or img.width GT url.width>
			<cfif img.height GT url.height >
				<cfimage action="resize" source="#img#" height="#url.height#" name="img">
			</cfif>
			<cfif img.width GT url.width>
				<cfimage action="resize" source="#img#" width="#url.width#" name="img">
			</cfif>
			<cfset data=toBinary(img)>
		</cfif>
		
		<cftry>
			<cffile action="write" file="#tmpfile#" output="#data#" createPath="true">
{'fraction_non_alphanumeric': 0.20817562452687358, 'fraction_numerical': 0.014635377239465052, 'mean_word_length': 5.1648522550544325, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7380331', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1515, 'n_words': 281}