[Gambas-user] Is exif Orientation obtainable without any exif libs/commands?
Tim Dickson
dickson.tim at googlemail.com
Tue Dec 6 15:30:42 CET 2022
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 ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221206/cbaf0409/attachment-0001.htm>
More information about the User
mailing list