Consulting

Results 1 to 7 of 7

Thread: Extract data from .jpeg images

  1. #1

    Extract data from .jpeg images

    Hi All,
    I am looking for an effective way to extract data from .jpeg images - I tried OneNote (Microsoft) by converting .jpeg images to .tiff, but it is not effective. The text files have no particular delimiter and I could not convert the data to Excel.
    Of course I am looking for a free software if available.
    Thanks in advance

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I'm not sure if this is what you are looking for and it's for Word but you could reconfigure it for Excel:

    [VBA]Option Explicit
    'You will need a reference to "Windows Script Host Object Model".
    Sub add_table_with_properties_and_thumbnails()
    Dim fso As FileSystemObject
    Dim fol As Folder
    Dim pic As File
    Dim tbl As Table
    Dim roe As Row
    Dim cel As Cell
    Dim ish As InlineShape
    Set fso = New FileSystemObject
    ' Set fol = fso.GetFolder("F:\Temp\Flowers")
    Set fol = fso.GetFolder("C:\Temp")
    Set tbl = ActiveDocument.Range.Tables.Add(ActiveDocument.Range(0, 0), 1, 3)
    For Each pic In fol.Files
    If LCase(Right(pic.Path, 4)) = ".jpg" Or LCase(Right(pic.Path, 5)) = ".jpeg" Then
    Set roe = ActiveDocument.Tables(1).Rows.Add
    Set cel = roe.Cells(1)
    cel.Range.Text = "Name" & vbCr & pic.Name & vbCr & vbCr & _
    "Date Created" & vbCr & pic.DateCreated & vbCr & vbCr & _
    "Size" & vbCr & pic.Size
    Set cel = roe.Cells(3)
    Set ish = cel.Range.InlineShapes.AddPicture(FileName:=pic.Path, LinkToFile:=False, SaveWithDocument:=True)
    End If
    Next
    End Sub[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Thanks, Lucas, for the reply.

    I tried the code on a .jpeg picture containing only text in a tabular form. This did not work - I am getting a copy of the picture in the new Word doc with some information about the .jpeg file.

    In fact OneNote does it better; but I am looking for some application, where I would be able to preserve the formatting of the data as far as possible for a possible inclusion in Excel.

    I understand that there are some commercial applications available, but I do not want to spend money on an application which I am going to use infrequently.

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I am looking for an effective way to extract data from .jpeg images
    I read this and that is what I responded to.

    Half of getting answers is asking the right questions.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    I assume you're refering to the EXIF information that is stored with in digital pictures.

    http://www.digicamhelp.com/glossary/exif-data/

    Almost all digital cameras save JPEG (.jpg) files with EXIF (Exchangeable Image File) data. Camera settings and scene information are recorded by the camera into the image file. Examples of stored information are shutter speed, date and time a photo was taken, focal length, exposure compensation, metering pattern and if a flash was used.
    There are a number of so-so freeware progs I've seen

    Try Googling for "EXIF data" etc. and see what you get

    Paul

  6. #6
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by Paul_Hossler
    I assume you're refering to the EXIF information that is stored with in digital pictures.
    If that is the case...


    http://msdn.microsoft.com/library/en-us/wiaaut/wia/wiax/overviews/startpagewiaaut.asp?frame=true

    is a free download from Microsoft which after registration can be called with CreateObject() - I believe you can get EXIF in addition to other information from the jpeg header. Stan

  7. #7
    Thanks, Stan, I'll try that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •