View Full Version : Extract data from .jpeg images
krishnak
03-15-2010, 07:50 PM
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
lucas
03-15-2010, 08:34 PM
I'm not sure if this is what you are looking for and it's for Word but you could reconfigure it for Excel:
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
krishnak
03-16-2010, 09:36 AM
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.
lucas
03-16-2010, 10:39 AM
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.
Paul_Hossler
03-18-2010, 07:39 AM
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 (http://www.digicamhelp.com/camera-features/advanced-settings/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 (http://www.digicamhelp.com/camera-features/advanced-settings/shutter-speed/), date and time a photo was taken, focal length, exposure compensation (http://www.digicamhelp.com/camera-features/advanced-settings/ec/), metering pattern (http://www.digicamhelp.com/camera-features/camera-modes/metering/) 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
stanl
03-20-2010, 08:23 AM
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 (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
krishnak
03-20-2010, 12:17 PM
Thanks, Stan, I'll try that.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.