thumbnail of pdf - wrong filename
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
at first view: works very fine!
question to other imagemagick/pdf-users here:
Please take an upload a pdf with more than one page - which page is displayed in the thumb? the first or the last?
question to other imagemagick/pdf-users here:
Please take an upload a pdf with more than one page - which page is displayed in the thumb? the first or the last?
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
Hi!
imagemagick always uses the first page.
Regards,
Garvin
imagemagick always uses the first page.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
Hi!
Hm, you are right. Strange, I could have sworn it was always the first page.
Try this patch:
HTH,
Garvin
Hm, you are right. Strange, I could have sworn it was always the first page.
Try this patch:
Code: Select all
Index: include/functions_images.inc.php
===================================================================
--- include/functions_images.inc.php (revision 2545)
+++ include/functions_images.inc.php (working copy)
@@ -659,7 +659,7 @@
}
$newSize = $r['width'] . 'x' . $r['height'];
if ($fdim['mime'] == 'application/pdf') {
- $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile . '.png');
+ $cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' "'. serendipity_escapeshellarg($infile) .'[0]" '. serendipity_escapeshellarg($outfile . '.png');
} else {
if (!$force_resize && serendipity_ini_bool(ini_get('safe_mode')) === false) {
$newSize .= '>'; // Tell imagemagick to not enlarge small images, only works if safe_mode is off (safe_mode turns > in to \>)
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
hm ...
Code: Select all
Konnte folgendes Programm nicht ausführen: "/usr/local/bin/convert -antialias -flatten -scale '130x130' "'/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.pdf'[0]" '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.serendipityThumb.pdf.png'", Fehlermeldung: , Rückgabewert: 1
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
Hi!"
Hm, seems the qupotes would need to be adjusted:
/usr/local/bin/convert -antialias -flatten -scale '130x130' '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.pdf'[0] '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.serendipityThumb.pdf.png'
Regards,
garvin
Hm, seems the qupotes would need to be adjusted:
/usr/local/bin/convert -antialias -flatten -scale '130x130' '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.pdf'[0] '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.serendipityThumb.pdf.png'
Regards,
garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
Now I tried this code with success:
so I think it will get this command:
But honestly I do not know why it works with '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.pdf'[0]
http://www.imagemagick.org/Usage/files/ ... postscript says it has to be
but I have:
but http://www.imagemagick.org/script/comma ... .php#input says:
Code: Select all
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .'[0] '. serendipity_escapeshellarg($outfile . '.png');
Code: Select all
/usr/local/bin/convert -antialias -flatten -scale '130x130' '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.pdf'[0] '/srv/xxx/uploads/intern/Einladung_Radtour_Juli_2009.serendipityThumb.pdf.png'
http://www.imagemagick.org/Usage/files/ ... postscript says it has to be
Code: Select all
convert document.pdf'[0]' first_page_of_pdf.gif
but http://www.imagemagick.org/script/comma ... .php#input says:
Selecting Frames
Some images formats contain more than one image frame. Perhaps you only want the first image, or the last, or some number of images in-between. You can specify which image frames to read by appending the image filename with the frame range enclosed in brackets. Here our image (an animated GIF) contains more than one frame but we only want the first:
$magick> convert 'images.gif[0]' image.png
[Unix shells generally interpret brackets so we enclosed the filename in quotes above. In a Windows command shell the brackets are not interpreted but using quotes doesn't hurt. However, in most cases the roles of single-quotes and dowuble-quotes are reversed with respect to Unix and Windows, so Windows users should usually try double-quotes where we display single-quotes, and vice versa.]
Ciao, Stephan
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
ha, I think this would be the right code!
so we get
and all is within the quotes!
Code: Select all
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile.'[0]') .' '. serendipity_escapeshellarg($outfile . '.png');
Code: Select all
/usr/local/bin/convert -antialias -flatten -scale '130x130' '/srv/xxx/uploads/intern/BriefOstern2009single1.pdf[0]' '/srv/xxx/uploads/intern/BriefOstern2009single1.serendipityThumb.pdf.png'
Ciao, Stephan
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
and now it would be fine to get the fix for the first problem (no thumbnail) for the gallery-plugin:
so that there is a thumbnail here, too:
http://www.sankt-joseph-siemensstadt.de ... 009-03-21/
(in the media library there is shown the thumbnail now.)
and another thing, related to the new functionality of pdf-thumbs:
selecting a pdf in the library I get the some options like for images, especially "thumb or the larger image?". Taking the thumb all works fine, now
But using larger image:
looks not realy good: a pdf as an image src
What is about this idea: no "thumb or larger image" but "thumbnail or text-link (as before the fix)"?
so that there is a thumbnail here, too:
http://www.sankt-joseph-siemensstadt.de ... 009-03-21/
(in the media library there is shown the thumbnail now.)
and another thing, related to the new functionality of pdf-thumbs:
selecting a pdf in the library I get the some options like for images, especially "thumb or the larger image?". Taking the thumb all works fine, now
But using larger image:
Code: Select all
<a class='serendipity_image_link' href='/uploads/Artikel/Gruppen/Ministranten/neue-minis-2009-joseph.pdf'><!-- s9ymdb:640 --><img width='1000' height='1000' style="border: 0px; padding-left: 5px; padding-right: 5px;" src="/uploads/Artikel/Gruppen/Ministranten/neue-minis-2009-joseph.pdf" alt="" /></a>
What is about this idea: no "thumb or larger image" but "thumbnail or text-link (as before the fix)"?
Ciao, Stephan
Re: thumbnail of pdf - wrong filename
Very cool, Garvin, thanks!
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
After updating to the actual release of s9y I got the error again - unfortunately my last patch for this did not found his way to the repositry
@garvin: please change the convert command in include/functions_images.inc.php
@garvin: please change the convert command in include/functions_images.inc.php
Code: Select all
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile.'[0]') .' '. serendipity_escapeshellarg($outfile . '.png');
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
Hi!
Thanks, committed! I thought I had this earlier, so sorry
Regards,
Garvin
Thanks, committed! I thought I had this earlier, so sorry
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
never mind!garvinhicking wrote:Hi!
Thanks, committed!
So, can we now turn towards the two little problems in http://board.s9y.org/viewtopic.php?p=88594#p88594? Please!
Ciao, Stephan
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
Hi!
Which little problems? You linked to this thread?!
Regards,
Garvin
Which little problems? You linked to this thread?!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: thumbnail of pdf - wrong filename
öh, yes. I mean the two things in post #88594 http://board.s9y.org/viewtopic.php?p=88594#p88594garvinhicking wrote:Hi!
Which little problems? You linked to this thread?!
no thumbnail in the the gallery-plugin
and
"looks not realy good: a pdf as an image src"
Ciao, Stephan