Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnails #60

Open
pcercuei opened this issue Mar 31, 2021 · 2 comments
Open

Thumbnails #60

pcercuei opened this issue Mar 31, 2021 · 2 comments

Comments

@pcercuei
Copy link
Contributor

It should be possible to support thumbnails by implementing the "Representative Sample" object properties.

The thumbnailing process itself should be deferred to an external program, pointed to in the config.

@jfdelnero
Copy link
Member

@pcercuei which way should we use to pass the thumbnail image data to the uMTP daemon ?

@pcercuei
Copy link
Contributor Author

pcercuei commented Jul 9, 2021

@jfdelnero there is a Freedesktop standard for that; The directory /usr/share/thumbnailers contains *.thumbnailer files with the following schema (example):

[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/svg+xml;image/svg+xml-compressed;

The Exec= line tells you how the thumbnailer should be called, (%s: size; %u: url/filepath; %o: output file). It will write the thumbnail to the given output PNG file.

However I believe it's not umtprd's job to create the thumbnails (there is probably an existing daemon for that). Umtprd should only have to open the thumbnails from ~/.cache/thumbnails/normal/{md5 of file}.png, and if it exist, use this PNG as the thumbnail for the MTP object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants