Fix: on ne pouvait voir que la premire page de l'aperu

This commit is contained in:
Regis Houssin 2006-03-01 16:21:19 +00:00
parent 85b930280c
commit b0542b730b
3 changed files with 13 additions and 6 deletions

View File

@ -207,6 +207,7 @@ if ($_GET["propalid"] > 0) {
// Chemin vers png aperçus
$relativepathimage = "${propalref}/${propalref}.pdf.png";
$relativepathimagebis = "${propalref}/${propalref}.pdf.png.0";
$relativepathimagebis2 = "${propalref}/${propalref}.pdf.png.1";
$fileimage = $file.".png"; // Si PDF d'1 page
$fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
@ -257,7 +258,7 @@ if ($_GET["propalid"] > 0) {
$description = imagick_faileddescription( $handle ) ;
print "handle failed!<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n";
}
imagick_writeimage( $handle, $file .".png");
imagick_writeimages( $handle, $file .".png");
} else {
$langs->load("other");
print '<font class="error">'.$langs->trans("ErrorNoImagickReadimage").'</font>';
@ -297,7 +298,8 @@ if (file_exists($fileimage))
// Si fichier png PDF de plus d'1 page trouvé
elseif (file_exists($fileimagebis))
{
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimagebis).'">';
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimagebis).'"><p>';
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimagebis2).'"></p>';
}

View File

@ -181,6 +181,7 @@ if ($_GET["id"] > 0) {
// Chemin vers png aperçus
$relativepathimage = "${commanderef}/${commanderef}.pdf.png";
$relativepathimagebis = "${commanderef}/${commanderef}.pdf.png.0";
$relativepathimagebis2 = "${commanderef}/${commanderef}.pdf.png.1";
$fileimage = $file.".png"; // Si PDF d'1 page
$fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
@ -231,7 +232,7 @@ if ($_GET["id"] > 0) {
$description = imagick_faileddescription( $handle ) ;
print "handle failed!<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n";
}
imagick_writeimage( $handle, $file .".png");
imagick_writeimages( $handle, $file .".png");
} else {
$langs->load("other");
print '<font class="error">'.$langs->trans("ErrorNoImagickReadimage").'</font>';
@ -289,7 +290,8 @@ if (file_exists($fileimage))
// Si fichier png PDF de plus d'1 page trouvé
elseif (file_exists($fileimagebis))
{
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimagebis).'">';
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimagebis).'"><p>';
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimagebis2).'"></p>';
}

View File

@ -143,6 +143,8 @@ if ($_GET["facid"] > 0)
// Chemin vers png aperçus
$relativepathimage = "${facref}/${facref}.pdf.png";
$relativepathimagebis = "${facref}/${facref}.pdf.png.0";
$relativepathimagebis2 = "${facref}/${facref}.pdf.png.1";
$fileimage = $file.".png"; // Si PDF d'1 page
$fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
@ -200,7 +202,7 @@ if ($_GET["facid"] > 0)
print "handle failed!<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n";
}
imagick_writeimage( $handle, $file .".png");
imagick_writeimages( $handle, $file .".png");
}
else
{
@ -239,7 +241,8 @@ if (file_exists($fileimage))
// Si fichier png PDF de plus d'1 page trouvé
elseif (file_exists($fileimagebis))
{
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimagebis).'">';
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimagebis).'"><p>';
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimagebis2).'"></p>';
}