> Is there any reason why you don't want to do it yourself, simply loading the 
> first KBs of the file ? I haven't been writing JPEG decoders for a loooong 
> time, but I'm pretty sure the EXIF (APPn) marker must be written before the 
> image data (the SOS marker(s)), so it is at the beginning of the file.

I had thought of that , too.
The reason is that I have no experience whatsoever with the JPEG file format.
Nor with the EXIF file format.
Also, I need to be able to parse at least JPEG, PNG, TIF, GIF, and I'd like to 
add HEIC.

Best regards, Gabriel

> You could simply parse the first markers of the file (0xFF, 0x??) and look 
> for the EXIF one. The JPEG file format (JFIF) is pretty simple to decode (I 
> can help).
>
> Regards,
>
> Raphaël
>
>
> On Sun, Jan 8, 2023 at 3:30 PM Chris Ridd via Cocoa-dev 
> <cocoa-dev@lists.apple.com> wrote:
>
>
> > On 7 Jan 2023, at 23:31, Gabriel Zachmann via Cocoa-dev 
> > <cocoa-dev@lists.apple.com> wrote:
> >
> >>
> >> I wonder if there is a method to load the EXIF data out of the files 
> >> without opening them completely.  That would seem like the ideal approach.
> >
> > That's the approach I am looking for, but I haven't found any API to do 
> > that.
>
> I’m sure you’ve tried the following, but in case you haven’t:
>
> * investigate mmapping each file into memory and use a version of the API 
> that takes NSData/CFData instead of a file/URL to get the EXIF information.
>
> * if the files are indexed by Spotlight, can you get the EXIF information 
> from a NSMetadataQuery search?
>
> Chris
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/lemoine.raphael%40gmail.com
>
> This email sent to lemoine.raph...@gmail.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to