+1

XKCD

General

I've added a link to my XKCD proxy.  This lets people behind firewalls view the latest XKCD comic.  You can find the link above, or click here.  Enjoy!

tags:
xkcd, proxy
+1

Resizing an image with CFImage (Creating a Thumbnail)

Coldfusion, cfimage

Yesterday, I got an email asking for some help on using CFImage to create thumbnails on a image that was submitted / uploaded through a form.  Here's a quick and dirty example of how to do just that.

<cfif Isdefined('form.FileUpload') and form.FileUpload NEQ ''>

	<!--- upload the image file from the form submission --->
	<cffile	action="upload"
			fileField="FileUpload"
			destination="#ExpandPath('/dev/images/')#"
			nameconflict="makeunique">

	<!--- Read the image, this only needs to be done once --->
	<cfimage name="TempImage"
			 source="#cffile.ServerDirectory#/#cffile.ServerFile#"
			 action="read">

	<!--- store image properties in a struct --->
	<cfimage action="info" structName="anImageStruct" source="#TempImage#">

	<!--- write the image out to the browser --->
	<p>Original Image (<cfoutput>#anImageStruct.width# X #anImageStruct.height#</cfoutput>)<br/>
	<cfimage action="WriteToBrowser" source="#TempImage#"></p>

	<!--- set the resize params --->
	<cfset ImageSetAntialiasing(TempImage,"on") />
	<cfset targetWidth = 100>
	<cfset ratioDivider = anImageStruct.width / targetWidth>
	<cfset width = anImageStruct.width / ratioDivider>
	<cfset height = NumberFormat(anImageStruct.height / ratioDivider)>

	<!--- perform the resize --->
	<cfimage action="resize"
			 height="#height#"
			 width="#width#"
			 source="#TempImage#"
			 name="ScaledImage"
			 quality="1"
			 destination="#cffile.ServerDirectory#/thumb_#cffile.ServerFile#"
			 overwrite="true"/>

	<!--- write the image out to the browser --->
	<p>Resized Image (<cfoutput>#width# X #height#</cfoutput>)<br/>
	<cfimage action="WriteToBrowser" source="#ScaledImage#"></p>


<cfelse>
	<!--- the form to upload an image --->
	<cfform action="#cgi.script_name#"
			method="post"
			enctype="multipart/form-data"
			name="theForm">

		<cfinput type="file" name="FileUpload">
		<cfinput name="submit" type="submit" value="Submit">

	</cfform>
</cfif>

Here's the output:

CFimage Thumnail Output

A couple of things to note here.  I have tried and tried to get the cfimage tag to overwrite an image that already exists with no success.  The workaround seems to be to just name the image something else, I've added thumb_ as a prefix to any thumbnail images.  Secondly, you may want to capture which file types you are willing to accept.  CFImage is limited to certain image formats that vary from OS to OS.  You can output the file types your system can handle by dumping the getReadableImageFormats() function.

+1

dlog private beta

dlog

I'm going to be releasing version 0.1.0b of dlog as a private beta.  To be part of it, shoot me a DM on twitter (@stevegood), or hit the Contact Form button below my picture here on the blog.  Either way, send me your email address and I'll make sure to get you included in the beta.

Things to expect in the 0.1.0b release:

  • Basic Twitter functionality
  • Ability to create a blog post (currently only for InstantSpot blogs) and assign categories to it.

Things to expect, in addition to above, before the public beta release (0.5.0b):

  • RegEx filtering and blocking for twitter / pownce / friendfeed messages and RSS feeds
  • Ability to create mashups of twitter /pownce / friendfeed with filters
  • Ability to edit or view blog entries
  • Support for more XMLRPC MetaWeblog API blog sites, like blogspot and blogger
  • Light weight RSS reader

I didn't include Jaiku in any of my features since, at the time of this posting, I still have not been sent an invitation to the service, which means no API access either.  If anyone knows a way for me to get an account on the service shoot me an email sgood [at] lanctr [dot] com or hit the contact form button on my blog.

Thanks for readin'! 

+1

dlog preview

twitter, Flex, dlog

Here's a preview of dlog, my AIR (desktop) app for blogging and microblogging built completely in Flex. Currently it handles service interfaces to twitter and instantspot. It's final release will include the ability to interact with twitter, pownce, friendfeed and jaiku for microblogging and any blogging site that uses the MetaWeblog API (XMLRPC). If you have any suggested services that could be integrated in please let me know, I'm always open to adding more functionality.

Here's the video!


dlog - v0.0.2b - 9-26-2008 from Steve Good on Vimeo

Here's a link to the uncompressed version, just a little over 6MB.
dl.getdropbox.com/u/208899/dlog-preview.mp4

tags:
AIR, Flex, dlog, preview
+1

Widget Outage - Widgets Back Online

Coldfusion, twitter, Flex, Widgets

x10hosting.com, the host where my widgets were being stored was doing server updates.  I've moved the widgets to the lanctr.com domain.  They are all back online again, but the wizards will need to be re-run to get the object and embed tags with the new domain.

Also, I had to remove the 2 minute Twitter widget refresh.  This morning I quickly hit the 100 requests per hour limit on my twitter proxy.  I'm looking into a solution for this and will have the widget updated when the solution is in hand.

Thanks for your patience!

+1

ColdFusion Book for Coda

Coldfusion, Coda, Mac OS X

With the 1.5 release of Coda, an OS X IDE, you can now create your own books. I've created one that uses the CF liveDocs.

Grab it here: learncf.lanctr.com/coda_books/CF%20LiveDocs.zip

To use the book, simply unzip the files into "<your home folder>/Library/Application Support/Coda/Books". Then fire up Coda and you should see the new CF Book in the Books view!

To learn more about Coda, which supports Subversion natively now by-the-way, check out www.panic.com/coda If you develop on a Mac I highly reccommend you give Coda a try.


Search