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

Bruce Steers bsteers4 at gmail.com
Wed Dec 7 12:44:39 CET 2022


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


On Tue, 6 Dec 2022 at 15:18, Fabien Bodard <gambas.fr at gmail.com> wrote:

> Hi Bruce,
> Have you try my thumbnail class ?
>
> It can return a well orientated thumbnail.
>
> And thumbnails are stored like all file browser following the freedesktop
> thumbnails spécifications.
>
>
>
> Le mar. 6 déc. 2022 à 16:00, Bruce Steers <bsteers4 at gmail.com> a écrit :
>
>> Cheers Tim, yeah i'm investigating. (already found that page:) )
>>
>> Might look into a gb.image.exif component or something here as exif has
>> quite a lot more than Orientation info, like ready made thumbnails for one.
>>
>> Could be worth looking into.
>>
>> Respects
>> BruceS
>>
>>
>> On Tue, 6 Dec 2022 at 14:31, Tim Dickson via User <
>> user at lists.gambas-basic.org> wrote:
>>
>>> why don't you look at the exif lib (that may not be on a system), and
>>> see how it does it. that should give you a pointer on implementing a
>>> gambas-only version.
>>> this doc may help.
>>> https://www.media.mit.edu/pia/Research/deepview/exif.html
>>>
>>> looks like you need the 0x0112 tag.
>>>
>>> regards, Tim
>>>
>>> On 05/12/2022 17:17, Bruce Steers wrote:
>>>
>>>
>>>
>>> On Mon, 5 Dec 2022 at 16:20, Rolf-Werner Eilert <rwe-sse at osnanet.de>
>>> wrote:
>>>
>>>> Am 05.12.22 um 17:06 schrieb Bruce Steers:
>>>> > So i've found exiftool is a tool to easily retrieve Orientation flag
>>>> > from an image but it's not on all systems, not by default at least.
>>>> >
>>>> > Was wondering if anyone has a method to retrieve exif flags from an
>>>> > image or the Orientation one at least?
>>>> >
>>>> > I found rotating and saving an image back to file removed it's
>>>> > Orientation flag so that's cool.
>>>> >
>>>> > But I also found that to save a similar size file back i needed an
>>>> > instruction like...
>>>> > hPicture.Save(sPath, 92)
>>>> >
>>>> > I had to play with the quality value and found 92 about the right
>>>> value
>>>> > for a similar size file.
>>>> > Wondered if there was a better way to save the image back with
>>>> identical
>>>> > file size (i assume a rotated image to be the same mass/size)
>>>> >
>>>> > Ultimately I'm looking to spin my images round to be correct way up
>>>> with
>>>> > zero quality change.
>>>> >
>>>> > The only piece of the puzzle gambas seems to lack is detecting the
>>>> exif
>>>> > Orientation flag.
>>>> > Something in my mind suspects gambas Read could possibly be able to
>>>> get
>>>> > the data from the files?
>>>> >
>>>> > Respects
>>>> > BruceS
>>>> >
>>>> >
>>>> >
>>>> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>>
>>>> Without looking in detail, but it should be in different positions
>>>> depending on the file format. So for instance you would have to know
>>>> where and how it is saved in a jpg file, open the file in binary mode,
>>>> and jump to the information. The same with other file formats.
>>>>
>>>> Or did I get you wrong?
>>>>
>>>> Regards
>>>> Rolf
>>>>
>>>
>>> Yes that's what I'm "suspecting" may be possible.
>>> Just wondering if anyone has tried and failed, or tried and succeeded ?
>>>
>>> looks like it's possible. I found this page...
>>> https://gist.github.com/yepitschunked/9d2e73d9228f5a0b300d75babe2c3796
>>> Has something i may be able to convert.
>>> And plenty to study
>>> https://www.media.mit.edu/pia/Research/deepview/exif.html
>>>
>>> Just hoping someone else might have already looked into it and have some
>>> working or unfinished code or just information they might share on the
>>> topic before i have to start at square 1.
>>>
>>> Respects
>>> BruceS
>>>
>>>
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>
>>>
>>>
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221207/1b77e580/attachment.htm>


More information about the User mailing list