JPEG vs JPG Extension not being calc'd correctly

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

JPEG vs JPG Extension not being calc'd correctly

Post by Jaymer »

(This is what I'm seeing on a customer's system.
I'm going to have to re-create this in a test BSV to be sure.)

This process runs from a "Upload" button in a Panel Operations area:

Code: Select all

CREATE Photos FOR EACH FileItem WITH 
Photos.PhotoDoc=FileItem.Doc,
Photos.Photo=FileItem.Doc,
Photos.Photoroute=SystemSettings.ImagesRoute+Estimate.EstimateNum+'\'+FILE_NAME(FileItem.Doc)+'.'+FILE_EXTENSION(FileItem.Doc)
I upload "abcde.jpg"

FileItem.Doc -> sets Photo_DOCTYPE in the db to have a .jpeg extension (incorrect, uploaded photo is .jpg)
FILE_EXTENSION(FileItem.Doc) --> returns .jpg
FILE_EXTENSION(Photos.Photo) --> returns .jpeg

I noticed this when I saved an image to local drive. I wondered why the extension was "jpeg" and not "jpg".

In my expression that calculates Photoroute, I was using Photos.Photo inside the FILE_EXTENSION function. That gave me ".jpeg".

If by chance you use FileItem.Doc inside the function, you'd get the correct value.
I don't know why the difference. In another rule, where I didn't have FileItem object, I get a different extension. Got a mismash all over my database now.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply