[mythtv-commits] Ticket #917: MythGallery Fast thumbnail loading using EXIF
MythTV
mythtv at cvs.mythtv.org
Wed Jan 11 20:02:56 UTC 2006
#917: MythGallery Fast thumbnail loading using EXIF
------------------------------------------------------+---------------------
Reporter: Grant Gardner <grant at lastweekend.com.au> | Owner: ijr
Type: patch | Status: reopened
Priority: minor | Milestone: 0.20
Component: mythgallery | Version: head
Severity: medium | Resolution:
------------------------------------------------------+---------------------
Changes (by Grant Gardner <grant at lastweekend.com.au>):
* resolution: invalid =>
* status: closed => reopened
Comment:
Hi apologies for spamming trac.
I realise I've got no mythtv cred/karma and my c++ is a bit rusty.
Anyway, the code below is from the exif demo provided on the libexif site
and shows how
to extract thumbnails using libexif. This is what I used to work out how
to do it.
{{{
...
} else if (extract_thumbnail) {
/* No thumbnail? Exit. */
if (!ed->data) {
fprintf (stderr, _("'%s' does not contain a thumbnail!"), *args);
fputc ('\n', stderr);
return (1);
}
/* Save the thumbnail */
f = fopen (fname, "wb");
if (!f) {
fprintf (stderr, _("Could not open '%s' for writing (%m)!"),
fname);
fputc ('\n', stderr);
return (1);
}
fwrite (ed->data, 1, ed->size, f);
fclose (f);
fprintf (stdout, _("Wrote file '%s'."),
fname);
}}}
I'll re-open the ticket with this new info. Happy for you to close it
again if you don't like the way it is done in which case I'll see if
anyone on the dev list knows a better way of getting the thumbnails out.
Cheers,
Grant
--
Ticket URL: <http://cvs.mythtv.org/trac/ticket/917>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list