Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 03/30/2011
Components: CFIMAGE
Versions: 9.0.1
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 281786
Priority/Frequency: Normal / Very few users will encounter
Locale/System: English / Win All
Vote Count: 1
Problem:
[ANeff] Bug for: image functions fail on png w/ .jpg extensionExamples:1) When a .jpg is renamed to .png, then isImageFile() returns true.2) When a .png is renamed to .jpg, then isImageFile() returns false.Another example: imageRead(PNG.jpg) throws error: "ColdFusion was unable to create an image from the specified source file. Ensure that the file is a valid image file."This can be problematic, when working w/ a png that someone has renamed from .png to .jpg.
Method:
<!--- isImageFile(JPG.png) returns YES ---><cfscript> myJPG = imageNew("", 10, 10, "grayscale", "black"); imageWrite(myJPG, expandPath("./myimage.jpg"), 1, true); fileMove(expandPath('./myimage.jpg'), expandPath('./myimage.png')); writeOutput(isImageFile(expandPath("./myimage.png")));//result "YES" (good)</cfscript><!--- isImageFile(PNG.jpg) returns NO (bug?) ---><cfscript> myPNG = imageNew("", 10, 10, "grayscale", "black"); imageWrite(myPNG, expandPath("./myimage.png"), 1, true); fileMove(expandPath('./myimage.png'), expandPath('./myimage.jpg')); writeOutput(isImageFile(expandPath("./myimage.jpg")));//result "NO" (bug?)</cfscript>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3043673
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email: 3D1D17B03C844EBF992001AC
External Test Config: 03/30/2011
Attachments:
Comments: