Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrive title from JPEG file
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01129211
Message ID:
01129226
Views:
10
Providing the information is there (in the JPEG) you cloud use WIA (Windows image acquisition) to get the title at propertiy 400091
Img = CreateObject("WIA.ImageFile")
Img.LoadFile ("C:\WINDOWS\Web\Wallpaper\Bliss.bmp")
s = "Width = " + TRANSFORM(Img.Width) + chr(13) + ;
    "Height = " + TRANSFORM(Img.Height) + chr(13) + ;
    "Depth = " + TRANSFORM(Img.PixelDepth) + chr(13) + ;
    "HorizontalResolution = " + TRANSFORM(Img.HorizontalResolution) + chr(13) + ;
    "VerticalResolution = " + TRANSFORM(Img.VerticalResolution) + chr(13) + ;
    "FrameCount = " + TRANSFORM(Img.FrameCount) + chr(13)
If Img.IsIndexedPixelFormat 
    s = s + "Pixel data contains palette indexes" + chr(13)
EndIf
If Img.IsAlphaPixelFormat
    s = s + "Pixel data has alpha information" + chr(13)
EndIf
If Img.IsExtendedPixelFormat 
    s = s + "Pixel data has extended color information (16 bit/channel)" + chr(13)
EndIf
If Img.IsAnimated 
    s = s + "Image is animated" + chr(13)
EndIf
If Img.Properties.Exists("40091") 
            v = Img.Properties("40091").Value
    s = s + "Title = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40092") 
            v = Img.Properties("40092").Value
    s = s + "Comment = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40093") 
            v = Img.Properties("40093").Value
    s = s + "Author = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40094") 
            v = Img.Properties("40094").Value
    s = s + "Keywords = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40095") 
            v = Img.Properties("40095").Value
    s = s + "Subject = " + v.String + chr(13)
EndIf
MESSAGEBOX( s)
>Hi folks,
>
>I have about 20 folders containing about 700 JPEG pictures from a digital camera, from which I need to build a database containing (at minimum) the file name, file date and time, and the title stored in the JPEG (other data would be nice as well, but I can live with just the title). The first two are easy -- but getting the title and related data from the JPEG is proving to be a real PITA. Most third party products will let you modify it, some show it to you, but none seem to let you extract it through any kind of API.
>
>Anybody know a quick, easy way to programmatically extract the "Title" property information from a JPEG file?
>
>
TIA,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform