|  | Intrafoundation Software > Freeware Mac OS X Gaming ColdFusion DOS Windows PHP Commercial Top All > > > |
## CFX_ImageInfo (2.6) `July 20 2003` by Lewis A. Sellers `Send related correspondence to: webmaster@intrafoundation.com` Windows ColdFusion CFX [w/ C source code] OBSOLETE ### Description This extension tag for Macromedia ColdFusion, CFX_ImageInfo, has one simple purpose: It returns information such as width, height, colors, comments, compression type, dpi, frames, etc about graphic files. The file formats it handles include TGA, GIF*, JPG, PNG, BMP, PCX, TIFF, and PSD. Works with ColdFusion version 3.1 and up. You can either ask it to return information about a single file or about all (known graphic) files in a specified folder. When using the folder option you can also specify a filter mask. With complete c/c++ source code. V e r s i o n H i s t o r y * 2.6, July 20th 2003. Updated to work under Java CFMX. NOTE: Was unable to confirm the concurrency tests under CFMX (no updates) as it always kills CFMX dead. (That never happened under CF4 or CF5). * 2.5, December 7th 2000. Would not report the error of an unsupported file type. Fixed. * 2.4, August 2nd, 4th 2000. Minor cleanup from last version for bmp and tga, etc. Stas, btw, is apparently working on a java-based conversion of this tag. You could almost write it in pure cfm now that cf4.5 has BinaryRead. Almost. Note that yes, some field are blank for some image formats. In some cases this is simply because the information doesn't exist in the headers. I'd have to decode the image to find out, and that would slow the tag considerably. Right now it ONLY reads in the headers, ie, framework descriptions, which means it does as little disk accessing and computation as possible. This makes it fairly fast. The other reason is that I've simply not gotten around to some of hte fields for some of the formats. Yet. * 2.3, August 1st 2000. Some minor bug fixes. Also: o Nelson Win noticed I'd completely forgotten strncpy doesn't append a null. Duh. Fixed. o Added BMP O/2 support for Stas (essentially rewrote the bmp module). Submitted CMYKos2 test bmps. o Added Format field for clarity If I ever have the time I'm going to rewrite a bunch of the code in clean, pure, MFC-free c++. When it was a little tag c was fine, but as it's grown it's showing signs of needing a proper refit to c++. Anyone seen my little gray woods kitty? * 2.2, July 20, 21 2000. Added transparency, transparencyindex fields. TransparencyIndex only works for gif currently. I might add it in for other formats later on. CONCURRENCY ISSUES: Was getting a report the tag was oddly failing in production after a couple hundred iterations of a page and in other odd circumstances. So... I ran some memory leak tests: There weren't any. Ran file handle tests: None were being stranded. Far as I can tell it's pretty much a rock even under high-load (tens of thousands of images) IF you're the only instance using it. So, I started looking at concurrency issues. Found a few simple things right off the bat. Sorry about that. Must have forgot to test for it after the 2.0 release. But they still didn't explain the original failure report. So added stresstest.cfm and concurrencytest.cfm. Under high concurrent load (many user browsers surfing pages with CFX_ImageInfo calls) the tag was doing very damn odd things, often requiring a cf service restart to gain control of ColdFusion. Thought perhaps it was a file contention issue, so added more error handling and other code in an attempt to isolate and contain any such occurances. Didn't help that much. I don't entirely understand what's going on (it's probably something simple I'm overlooking that'll dawn on me in a day or two) but the effect is that if two instances of CFX_ImageInfo try to read a file at the same time then the tag is still openable but we read garbage (zero) values. Sometimes it just sits in an infinite loop (waiting for a file?). I'm assuming it's a threading issue, but until it can be isolated the use of CFLOCK is highly suggested (you should have been using it anyway, as it is the general standard with cfx tags.) Then again it could simply be the machine I'm deving on: CF4.0.1, NT4sp6. All the other deving could have left something unstable. I'll try it on others later. Feel free to do the same and report if you have problems or if you don't. :) Sorry about the inconvience. * 2.1, 6/2/2000. This had came up before in a round-about way, and I'd thought about doing such, but I saw a bit of code by Stephane Bisson the other day on the Allaire forums and thought I'd go ahead and take a few minutes to add proper, searchable, error codes: [GRAMMAR], [FILEDOESNOTEXIST], [UNSUPPORTEDFORMAT], [UNSUPPORTEDSUBTYPE], [CORRUPT] and [ENDOFFILE]. I can see no reason that this should ever change, even if someday we another major upgrade to a 3.x version. Thus, from now on the safe way for error checking is to simply look fo those keywords in the error field. Please see the definition for ImageInfoError and ImageInfo.Error for more details. * 2.0, 5/28/2000. READ THIS! A half year ago (with the 0.9 release) a FOLDER option was added that returned all data back in an SQL query. To retain compatibility with the older version however the FILE parameter still returned the data back as a set of CFSET-compatible variables. As of 2.0 this has finally been dropped. *ALL* image information is returned in the SQL query that FOLDER has always used. If all you've ever used was FOLDER then this doesn't affect you. If any of your code uses FILE however you will need to modify your cfm pages to reflect this change or continue using the old 1.8 version. However, in most cases, changing your code will be fairly quick and painless. After all, how long does it take to change "ImageInfoWidth" to "ImageInfo.Width", etc? :-) This change comes about because the structure of the source code was rewritten. It's now harder for novices to read, but it's more in line with proper coding practices. (It had been nagging at me for the last few months). Anyway, what's done is done. Hopefully the code is tighter, faster and less problematic as a result. Additional changes include: o Fix of repetitive "premature eof" error messages. You should only see one per file now. o Fixed major end-of-file bug for JPG. Should process them faster now as well. o Added "path" to the returned query. It contains the full path and filename as "file" used to. o Changed "file" to only return the filename and not the entire path. o Added FILTER for the FOLDER option. You can now use DOS wildcard filter characters (* and ?). o misc cleanup o fixed bug that could leave out first row in the returned query. o Removed fpx (flashpix) stub. If you have header info for fpx, send it. I have no idea what the format for fpx is. o Didn't mention it before, but, while I'm writing a novella-length update, I believe Kristin Aileen Motlagh has a book coming out with this tag in it. (At least, I recall signing a release form for something a couple months back. hrmmm...) o tighter code and less file accessing should made the tag faster than it ever has been NOTE:In response to some confusion, no, this tag does not have any relation to the CFX_ImgInfo program by Scott Howard circa 1997. I was unware of the tag in question until sometime after I created this one, otherwise I probably would have given it another name (to avoid people asking me questions about Scott's tag.) * 1.8, 4/14/2000. Misc. Fixed PNG comments and comments in general. Some programs create PNG Creation Time text that is not to spec. * 1.7, 4/7/2000. Fix LastMod/Created. Add LastAccess. * 1.6, Quick change for g. butterwegge so that LastMod and Created fields use ODBC compatible timedate format. * Zipped all test images as a seperate .ZIP so you don't have to download them over and over. 1.5, 3/28/2000. By request (g. butterwegge) added LastMod and Created fields. Misc other. * 1.4, 2/28/2000. Documentation amplifications and addition of a more "formal" copyright statement. No significant change to the code base itself. (As much as I might be tempted.) * 1.3, 2/7/2000. Apparently Drew was having problems getting the tag to work with mapped shares (network drives). Reworked the code a little for shares. Also made error messages a little more verbose. * 1.2, 1/21/2000. bug fix. GIF's with a color resolution other than "3" (less than 256 colors) were being incorrectly read. Fixed according to/for Golem. * 1.1, 1/18/2000. There were requests for jpeg DPI info (phillippi) and reporting of gif animation features such as frames/layers and duration (golem). Those have been added. There probably will be a cleaned-up 1.2 shortly as I'm about to release the commercial big brother to this tag. Since it's a c++ dcom object (cf or asp) it doesn't exactly translate easily to the simplier c code of this tag, but a few new features will probably find their way into it. * 1.0 Stable, 12/15/1999. Well, it's been over half a year since the tag was released into the wild, and there doesn't seem to be any currently existant issues with the code. So... I went ahead and graduated it to a 1.0 gamma version. Congrats CFX_ImageInfo. /-) From now on we're in a feature-lock. That means only issues to make the tag faster and more stable will be addressed. I need to read up on exactly what the GPL license specifically involves before I officially state it, but this tag and it's included code are essentially GPL'd in all but name. * .13. 12/3/1999,12/15/1999. More final clean up. Feature lock. Copied code-base to CFX_ImageInfoSM/CFX_Thumbnails project (generates thumbnails). Stable. Should be last mod for at least the next half year. Added hooks for a couple a/v formats (AVI,MOV,MPEG) but no active code. Something for the future perhaps. Moving future additions to CFX_ImageFX. * .12 12/2/1999. Bug hunt and polishing. * .11, 11/30/1999. Added TIFF support. Sort of. TIFF is a hideously complex image format with some fairly silly concepts of flow design. More or less works though. * Fixed other misc problems like reporting >=32 bit color formats. Added PSD 2.0. .10, 11/30/1999. Limited release. Fixed problem with JPG comments not having nulls. Fixed DPI always reporting 72. And other misc. * .09, 11/29/1999. Mark Gaulin pointed out I'd forgotten a free() in a function. fixed. Recoded many portions such as bmp.h, and tweaked them to report information a little more accurately in some cases. Added FOLDER option. Added code to read PCX. * .08, Unreleased * .07, 5/21/99 The long-standing release version * .06 and before, prehistoric ### Version History There is no known history available. #### [Manual friendly version] | ### Download We hope you find your download of use. (615 KB) version 2.6 (`July 20 2003`) `views 884` downloads 756 (June 19 2007) ### Gallery There is no gallery currently available. ### Comments Leave a comment There are no comments about this product. Be the first to leave a comment. View all product comments/replies