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?
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 \>)
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: 1Code: 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'Code: Select all
convert document.pdf'[0]' first_page_of_pdf.gifSelecting 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.]
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'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>Code: Select all
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile.'[0]') .' '. serendipity_escapeshellarg($outfile . '.png');never mind!garvinhicking wrote:Hi!
Thanks, committed!
ö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?!