[Gambas-user] Is exif Orientation obtainable without any exif libs/commands?

Bruce Steers bsteers4 at gmail.com
Sat Feb 18 14:24:04 CET 2023

I'm completely out of my depth here.

So far i have figured out how to extract the exif data  :)
 but not how to process the info out of it?  :(

the best resource so far i have found is this...

But my brain is hurting trying to understand it.

I have successfully (i think) read in the exif data like this...

Private $hExifRawData As Variant

Public Sub GetData(sFile As String)

  $hExifRawData = Null

  Dim f As Stream
  f = Open sFile For Read

  Dim bGetData As Boolean
    Dim sChar As Variant = Read #f, 2

    If bGetData Then
      If sChar = "\xFF\xE2" Then
        Print "got exif end"
        $hExifRawData &= sChar
      If sChar = "\xFF\xE1" Then
        bGetData = True
        Print "got exif"
    If Not Lof(f) Then Break

  Close #f


But no idea what to do with it.
Trial and error i guess

If anyone has extracted jpeg/exif data and got any code to share that would
be cool :)


On Wed, 7 Dec 2022 at 21:08, Fabien Bodard <gambas.fr at gmail.com> wrote:

> Le mer. 7 déc. 2022 à 12:45, Bruce Steers <bsteers4 at gmail.com> a écrit :
>> I did try it Fab it's er, Fab :)
>> Looks awesome but i think i will have to carry on down this exif path for
>> now.
>> The core of what i am doing is making something to help my girlfriend
>> sort through her 6x 4tb hard drives that are FULL of many years worth of
>> badly organized and many duplicates phone camera pictures. :-\
>> exif seems to have all that's needed if i can figure an interface.
>> the fact the jpeg files may contain their own ready made thumbnails seems
>> a real bonus that can be utilized.
>> But that's just a secondary function that will speed up viewing previews.
>> Your function does seem pretty cool but (of course) it has to generate
>> the thumbnails the first run and on some of her huge folders it took quite
>> a while so i would want to utilize Task.class or something like fileview
>> does to load thumbnails in the background.
>> But..
>> I need more, I also want a function to rotate pictures to their correct
>> orientation, not just for the preview but the actual image on the disk so i
>> need a bit more than thumbnail generation. Also date info/etc may be useful.
>> i think I'm going to continue with trying to read/write the exif data as
>> I think it could be pretty good if i can extract it's own thumbnails
>> quicker. plus there's other info in the exif that could be useful for a
>> photo organiser
>> Much respect.
>> BruceS
>  it's an interesting work 🙂.
>> You need to work on the jpeg file structure or use an external tool to
> extract all that datas.
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230218/622d6faa/attachment.htm>

More information about the User mailing list