Announcement

#1 2016-09-16 21:36:42

vidal
Member
2016-09-16
9

PDF thumbnail generation or Image with PDF Link?

Hi,


I trying to get the PDF generation to work, but I can't get thumbnail generation to work.
Is it really possible?

I also have this in my config, found it here somewhere on the forum.

$conf['file_ext'] = array_merge(
  $conf['picture_ext'],
  array('pdf')
  );
$conf['upload_form_all_types'] = true;

Plugins:
Charlie's content 3.0.1

System info:
Piwigo 2.8.2
PHP: 5.5.36
MySQL: 5.5.5-10.0.25-MariaDB
Graphics Library: GD bundled (2.1.0 compatible)

Last edited by vidal (2016-09-16 21:40:19)

Offline

 

#2 2016-09-17 09:39:09

vidal
Member
2016-09-16
9

Re: PDF thumbnail generation or Image with PDF Link?

Ok got it working with the File Uploader plugin, great!

Offline

 

#3 2016-11-06 11:30:51

jdd
Member
Toulouse (France)
2009-12-19
118

Re: PDF thumbnail generation or Image with PDF Link?

Hello,

I find this thread by chance, looking for something else.

AFAIK, Piwigo can't generate thumnail for pdf files (if one know a way to trigger this, I'm interested), but you can build one yourself and upload it with ftp

One can do this by hand, but I use a script:

Code:

#!/bin/sh
b=`echo "$1" | cut -d'.' -f1` ;
mkdir pwg_representative ;  
detox -v -s utf_8 $1
convert $1[0] -resize 128x128 pwg_representative/$b.jpg
convert pwg_representative/$b.jpg -pointsize 20 -draw "gravity south fill black  text 0,12 'PDF' fill white  text 1,11 'PDF' " pwg_representative/$b.jpg

the script extract the base name of the file (the part before the dot) then create the thumbnails folder. detox is an utility that makes sure the file name is convenient for piwigo.

the first convert name create a thumbnail, then the second line writes "PDF" on it.

jdd

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact