Full PDF Support, including internal viewer, just like jpg

Just wanted to throw my support for full support of pdf files.

1 Like

How so?

jpegs are displayed as thumbnails and gramplets (Media Preview and Photo Tagging) inside Gramps. But there isn’t a full view inside the application. Which is probably good … since the OS selected application for the file extension is probably more capable than an internal tool would be.

The Object Editor would certainly benefit from a PDF thumbnail instead of a generic document icon. (And it would be better yet if the page could be specified for the thumbnail.)

Fedora’s “Grid View” with thumbnails.

Although a PDF form inside a view would be useful!

Our Gnome thumbnailer already supports pdf files.

For other operating systems it would be fairly easy to write your own pdf thumbnailer addon.

1 Like

I’ve got Fedora 37 running Gnome 43.9 desktop and it is providing PDF thumbnails for the OS… but they aren’t showing up in Gramps.

How do I troubleshoot that built-in thumbnailer on Gramps 5.2.1?

Have look in the /usr/share/thumbnailers directory. It contains files that define how to run the available thumbnailers and what mime types they support.

In my case I have the file evince.thumbnailer which states that evince supports the application/pdf mime type. Do you have evince installed? I think that it should be a default Gnome package.

1 Like
[Thumbnailer Entry]
TryExec=evince-thumbnailer
Exec=evince-thumbnailer -s %s %u %o
MimeType=application/vnd.comicbook-rar;application/vnd.comicbook+zip;application/x-cb7;application/x-cbr;application/x-cbt;application/x-cbz;application/x-ext-cb7;application/x-ext-cbr;application/x-ext-cbt;application/x-ext-cbz;application/x-ext-djv;application/x-ext-djvu;image/vnd.djvu;application/x-bzdvi;application/x-dvi;application/x-ext-dvi;application/x-gzdvi;application/pdf;application/x-bzpdf;application/x-ext-pdf;application/x-gzpdf;application/x-xzpdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;application/x-ext-eps;application/x-ext-ps;image/x-bzeps;image/x-eps;image/x-gzeps;image/tiff;application/oxps;application/vnd.ms-xpsdocument;application/illustrator

Apparently so. Going to my Documents folder shows a Thumbnail in the OS
image
In Gramps, no thumbnail

In the terminal, I go to the Documents folder and running evince Reno_March_2007.pdf loads Document Viewer with:

@Nick-Hall thanks for that tip. I installed evince and now I have thumbnails for pdf files. Do you happen to know offhand of a thumbnailer that handles jp2 (jpeg2000) and rtf files?

FYI, Web API uses pillow & pdf2image to generate PDF thumbnails.

1 Like

The totem thumbnailer handles jp2 files.

I had to edit the file /usr/share/thumbnailers/totem.thumbnailer and append image/jp2; to the list of mime types to get it to work. For some reason it was disabled by default (or they forgot to add it to the list).

1 Like

Is the following in the 2022 GitHub Pull Request 1164 applicable?: No. 1164 was closed on Mar 26, 2022 in favor of Add support for thumbnailer plugins #1363, merged on Mar 26, 2022

make sure the is_supported() method always returns False if the pymupdf package is not installed

I am running into conflicts with SELinux. The evince.thumbnailer is using a different context to write into the thumbnails folders at ~/.gramps/thumbs. If I disable SELinux, the thumbnails work. I get the following error details:


*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that evince-thumbnai should be allowed write access on the large directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'evince-thumbnai' --raw | audit2allow -M my-evincethumbnai
# semodule -X 300 -i my-evincethumbnai.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:thumb_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/sbb/.gramps/thumb/large [ dir ]
Source                        evince-thumbnai
Source Path                   evince-thumbnai
Port                          <Unknown>
Host                          dingo
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-41.38-1.fc41.noarch
Local Policy RPM              selinux-policy-targeted-41.38-1.fc41.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     dingo
Platform                      Linux dingo 6.14.4-200.fc41.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Apr 25 15:45:16 UTC 2025
                              x86_64
Alert Count                   154
First Seen                    2025-04-26 13:49:31 CDT
Last Seen                     2025-05-06 09:46:13 CDT
Local ID                      dab8654d-354d-4770-a787-510fcd000e50

Raw Audit Messages
type=AVC msg=audit(1746542773.814:589): avc:  denied  { write } for  pid=64319 comm="evince-thumbnai" name="large" dev="dm-3" ino=2904098 scontext=unconfined_u:unconfined_r:thumb_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=0


Hash: evince-thumbnai,thumb_t,user_home_t,dir,write```
1 Like