Adobe MAX 2006 Session - Image Manipulation in ColdFusion Scorpio

I'm sitting in on Prayank Swaroop's Image Manipulation in ColdFusion session right now. It's the last of three sessions on new features/functionality coming out in ColdFusion 8 (Scorpio). Image manipulation is something a LOT of people have been asking for for quite a long time, so it's nice to see it finally being implemented.

The new cfimage tag and over 45 supporting functions will support the following:

  • Creating images
  • Image conversion
  • Thumbnails and resizing
  • JPEG compression
  • Adding text
  • Watermarking
  • Base64 support
  • Captchas
  • Blobs
  • Exif and IPTC (only for JPEG)
  • Basic graphic functions
  • Magic of drawing strokes

view plain print about
1<cfimage source="foo.jog" name="myImage" action="read">
2
3<cfset myImage = imageNew("foo.jpg")>

Inputs include URL's, files,

You'll be able to read in all sorts of meta information about images - dimensions, color space, resolution, etc.

Image conversion supports jpg, gif (not animated), png, bmp and tiff. Other formats that can be read/written but have not been tested are FlashPix, etc.

If you're working with jpegs, you can specify the compression rate (0.75 is the default) using the quality attribute of the cfimage tag.

Image manipulation includes Rotate:

view plain print about
1<cfset foo = imageRotate(myImage, 45)>

Resize:

view plain print about
1<!--- 2nd attribute is width, 3rd attribute is height --->
2<cfset foo = imageResize(myImage, "50%", "")>

Border:

view plain print about
1<!--- 2nd atribute is thickness, 3rd is color,4th is border shape --->
2<cfset foo = imageAddBorder(myImage, 5, "red", "constant">

Many more functions including imageShear, imageNegative, imageBrighten, imageBlur, etc.

Image resizing can be fixed width and height, proportional, and scale to fit.

Because there are so many functions, with lots of repeating attributes, you can use attribute collections and pass them to the image functions.

Base64 support allows you to embed images in HTML pages and emails. The new tags/functions allow you to do this a little easier than the current cffile/toBase64() method.

The cfimage tag will also support PNG captchas:

view plain print about
1<cfimage action="captcha"
2width="600"
3height="150"
4text="SAMPLE"
5difficulty="low" <!--- low, medium, high" --->
6destination="captcha.png">

Another cool feature is blob support. You'll be able to read and write blobs as well as convert images to blobs, making inserting and retrieving images from a database easy.

Exif and IPTC image metadata standards are supported for JPEG images. You can use the imageGetExifMetaData() and imageGetIPTCMetaData() functions respectively. There currently aren't any write functions, but that is subject to change before release.

There are quite a few drawing functions as well: geometric primitives, cubic and quadratic curves, and more. I think these are going to be interesting. One use case I have is diagraming workflow's. We have a workflow engine we use in several of our applications. It would be pretty cool to use the image drawing functions to actually diagram the workflow within a workflow administration application to make visualizing the workflow easier.

It looks to me like the cfimage tag and related functions in Scorpio are finally going to deliver a pretty powerful feature set that's been sorely lacking in ColdFusion for some time. Kudos to the development team on the implementation so far.

Given the information from the presentation, is there anything you feel the team may be missing?

Adobe MAX 2006 Session - Unlocking the ColdFusion Server Black Box in Scorpio

I'm in Ashwin J Mathew's Unlocking the ColdFusion Server Black Box session right now. I had the opportunity to talk with Ashwin a bit last night, so I was pretty excited to see what he had to formally say on Scorpio's new server monitoring capabilities.

Right off that bat, he's showing screen shots of the application, which has a nice Flex front end. The server monitor is a ColdFusion app with Flex up front that runs within the ColdFusion administrator. It's useful for analyzing problems during development as well as pinpointing bottlenecks on production servers. It allows administrators to monitor overall server health. It's safe to run on production systems.

The Summary Screen shows JVM memory status, average request time, slowest active requests, reports, alerts, and errors. From there, you can pull up all sorts of other reports, charts, and graphs. Some of them are being demonstrated...

The template cache graph shows you exactly how the template cache is performing. Reports for slowest queries, slowest queries by average, queries by memory usage, and query cache.

Lots and lots of questions about how exactly certain features have been implemented, and lots of people asking for additional functionality. Ashwin's stated that the monitor isn't done yet, so there's most likely more to come. The monitor can also be used to track and analyze errors and timeouts.

The monitor can also be used for detailed request profiling. You can take a given request and show exactly which tags and functions are taking the most time to run. There's no code to add, just run the profiler and get the information you are looking for. The profiler also is useful for analyzing memory usage. It shows how much memory each variable is consuming. It shows the variable name, type, memory size, and what template is responsible. The report currently covers the top 10 largest variables, memory foot print wise. AWESOME!!!

There's a snapshot feature that allows you to take a snapshot of your server at any point in time and dump out the results for analysis.

You can also create alerts for various conditions you want to monitor. There are alerts for Hung Server and Slow Server. You can also create your own Alert types by creating custom CFCs.

Requests can also be filtered for monitoring, allowing you to include/exclude certain aspects of your site/server for monitoring.

Lots more reports including active sessions, active queries, request throttle data, database connection pool, highest hit counts, and more!

Lots of switches for turning on/off various aspects of the monitor: monitoring (everything), profiling, and memory tracking. Each aspect has a performance impact. Monitoring and profiling are minimum. Memory tracking can have a significant impact.

Finally, the infrastructure that supports the server monitoring app is CFC driven. What's particularly cool is that the whole thing is exposed as an API (servermonitoring.cfc) , allowing you to build your own applications and interfaces using the underlying monitor. Currently, there are between 40 & 50 methods.

The server monitor certainly shows a lot of promise. It's something we've been asking for for a long time. One interesting question is will it replace, or complement tools like SeeFusion and FusionReactor?

Adobe MAX 2006 Session - ColdFusion .Net Integration in Scorpio

I'm sitting in Rupesh's ColdFusion .Net Integration session right now. The main benefits of .Net integration has to do with leveraging some .Net functionality within ColdFusion. Adobe has no plans to port ColdFusion to the .Net platform, but their integration strategy should make it easier to leverage MS products like Excel, Word, Outlook, Exchange, etc. The .Net integration will also let you integrate with components and services created in .Net.

Right now, the only way to integrate with .Net is via web services, messaging, or by using COM. With the Scorpio release, you'll be able to integrate with .Net using what's called Runtime Unification - just like we do now with COM, CORBA, and Java - via createObject() and the cfobject tag (type=".net").

The Runtime Unification makes .Net assemblies locally available. It gives you more fine grained control than the previously mentioned integration strategies. Benefits include:

  • Tight coupling
  • Fine grained control as it's a local object
  • High performance, reliability and security
  • Stateful
  • Communication can be binary (default) or http for use across firewalls
  • Supports SSL

Syntax for calling looks like this:

view plain print about
1<cfobject type=".Net"
2class=".Net class"
3assembly="assembly"
4name="return object name"
5host="host"
6port="port">

7
8Instantiating a .Net object:
9
10<cfobject type=".Net" class="com.comp.Account" assembly="act.dll" name="act">
11<cfset act.init("Rupesh", 1000)>
12
13Calling static methods:
14<cfset types = act.getAccountTypes()>
15<!--- no need to init a call to a static method --->

Rupesh then went on to show an example of using a few lines of code to generate a MS Word document. It was FAST and relatively simple to do. Finally, native integration without having to use COM or Apache POI!

There's also automatic datatype conversion fr primitive .Net datatypes to CF and CF to .Net. Decimal type is not supported. You can also use javaCast() where required (ambiguous method arguments).

There's a chart for datatype mapping from .Net to Java. All primitive types are supported except for decimal.

Deployment scenarios include ColdFusion and .Net on the same server, ColdFusion and .Net on separate Windows machines, and ColdFusion on other platforms with .Net installed on a Separate Windows machine. Each of these configurations has various configurations and steps required to make it all work. The simplest is CF and .Net on the same machine, but it will work across all three of the options.

Some limitations: Enum and decimal datatype not currently supported. Methods with out parameters as arguments and methods with pointers as arguments or return types are also not supported. Unfortunately, you also can't use .Net UI components. Callbacks are also not supported.

Adobe Apollo - What am I Missing?

The one thing I still don't get about Apollo, Adobe's upcoming RIA desktop platform, is this: am I really going to want to have potentially dozens of new applications installed on my desktop to do a lot of what I do now in my browser? The offline piece of the technology I totally understand, and as a developer, I think the technology and possibilities are pretty amazing, but I'm still not convinced that the average user (like my mom) is going to get it. Help convince me I'm wrong.

Adobe MAX 2006 Day 1 Keynote

The Adobe MAX 2006 keynote opened up with the Blue Man Group performing for the crowd of over 3000 attendees. If you've never seen Blue Man Group, they put on an entertaining show - and did a great job of getting the crowd going.

Shantanu Narayen is talking about the Macromedia/Adobe merger, likening it to a marriage. Lots of video of customer feelings on the merger - some pretty funny stuff. There's a lot of talk about making the developer and designer workflow better, unifying the user interface as much as possible. Adobe has fully embraced the labs concept first put forth by Macromedia.

A little more humor, letting us know that Ben Forta's racked up over 3 million air miles evangelizing ColdFusion.

Milestones:

  • Flash lite is now on over 100 million devices world wide. Adobe is continuing Macromedia's work to really push Flash out to mobile devices.
  • Delivery of Flex 2.0. Over 100,000 developers have downloaded the technology.
  • Flash Player 9 - performance is where it needs to be to enable next gen of apps
  • Flash turns 10
  • Acrobat 8
  • Breeze integrated into Reader and Acrobat

Where does Adobe go from here? Beyond Boundaries - the theme from MAX. Adobe's strategy can be summed up as "Engagement".

Next up is Kevin Lynch. Flash player upgrades can now be done relatively quickly. Adoption of Flash Player 8 hit 80% in just under 9 months. They're shooting for 80% in 6-9 months for Flash Player 9.

Performance in the Flash Player 9 virtual machine is greatly improved. Kevin showed a demo of a particle based animation of fire. The demo ran at around 100 ms per frame in AS2. In AS3, it came in at 5 ms per frame. That's 20x faster.

Flash Video has a lot of momentum. Over 200,000,000 PDF files on the web.

Kevin then spent some time talking about workflows.

The first one was HTML design. The typical workflow goes Photoshop (comp), Fireworks (prototype), Dreamweaver (HTML), Spry (Interactivity). Adobe is putting a lot of energy into being able to seamlessly move from one tool to the next in the workflow - this includes being able to cut and paste from Photoshop into Dreamweaver. Dreamweaver/Spry integration is coming, making it "easy" for designers to add Ajax functionality without having to be "developers".

Mike Downey and Steve Kilisky talked about the dynamic media workflow: Photoshop (Comp), Flash IDE, After Effects, and Soundbooth.

Photoshop gets an iconic palette mode, allowing you to collapse docked panels. Flash will soon allow for natively importing PSD files, with options to select which layers to import. After Effects gets a new puppet tool that lets you animate more organically and expressively. You'll also be able to add cue points directly in the timeline. Flash Video will be able to be output directly from the After Effects render queue - meaning you'll be able to do batch video creation, something that you can't do today. A new product called Soundbooth will let you work with audio specifically for Flash. Should be up on Adobe Labs this week. Improvements in the video importer make it easier to import and use video with the Flash IDE.

Sho Kuwamoto showed off the RIA workflow building a music sharing/playing application: Photoshop/Illustrator (comp), Flex (build app), and ColdFusion (manage and deliver data).

Illustrator will be able to export symbols as SWFs. You can then take that art and bring it into Flex by a simple stylesheet declaration. This makes re-skinning really easy.

Next, Sho created a ColdFusion page (cfm) that generated an XML playlist file. Flex then calls the cfm file to get its data. A few lines of code are all that's required to pull the data from ColdFusion and display it in a grid. The whole app took him all of 10 mins to create. Also noted was that Sho was doing his development on a Mac, meaning the Mac version of Flex Builder is forthcoming. Public Beta is being distributed at the conference.

Next up, Ben Forta. He gave a quick recap of ColdFusion 7, ColdFusion 7.0.2 and Scorpio (ColdFusion 8) before showing how the ColdFusion back end for the music player was built. He opened Flex Builder with the ColdFusion extensions (an install-time option) and showed the ColdFusion/Flex Application Wizard. Stepping through the wizard, he was able to generate a complete application with Flex front end and ColdFusion back end in about 5 minutes. The wizard generated all of the necessary Flex and ColdFusion code.

Scorpio is going to have image processing, server monitoring and .Net integration. There are conference sessions on each of these. There's also a lot more coming later. There wasn't much time to show off features during the keynote, so Ben decided to show the new image processing capabilities. Over 50 new functions are being added to deal with image manipulation. More Scorpio functionality will be unveiled later this week. There's also a meet the CF team session.

Ben also did the discussion and demo for the electronic document workflow. This workflow consists of designing printed forms and developing interactive forms. He took a paper based insurance claim form and scanned it into PDF. He then used a field recognition wizard in LiveCycle Designer to automatically recognize all of the fields in the scanned form - very impressive. He also showed a Flash/Flex app that seamlessly integrated with a PDF document. Updating the Flex app caused the form to be populated. Changing a value in the form caused the app to update. What really seemed to rock people was a Flex wizard in LiveCycle designer that allowed him to take the PDF form and generate a Flex representation of that form, including all of the code to synch the data between the two. Ben also mentioned that Scorpio will contain additional hooks into this as well!

Last but not least is Ed Rowe on Apollo. Apollo is RIA for the desktop. It allows you to create occassionally connected applications for working on or offline. The value proposition is really that you can create a whole new generation of applications using skills we already have - ActionScript, Flex, XML, video, audio, HTML, Ajax, JavaScript, SWF, PDF, etc.

Ed's next demo showed Google maps running stand-alone, outside of the browser on Apollo.

The Apollo deployment package contains all of the assets necessary to run the application. Activating the package installs the application to the local machine for the user to run.

Last up is Kevin Lynch again showing a bunch of Apollo apps for things like MySpace chat, eBay, mortgage applications, Nimbus word processor, and more. His final app demo is an internet video app where video is delivered to an Apollo based player using RSS.

Kevin also announced the creation of a $100,000,000 investment fund for Apollo based applications and technology.

The keynote ended with a display of the largest device on the planet with Flash player installed - the new Jaguar. Pretty cool Flash based navigation and control system.

That's about it from the keynote. Stay tuned for more...