diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 7d01174fb37..f4a0e149898 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -152,6 +152,9 @@ print '
';
print '
'."\n";
+if (! empty($conf->use_javascript_ajax))
+{
+
$infoarray=dol_getImageSize($conf->product->dir_output."/".urldecode($_GET["file"]));
$height=$infoarray['height'];
$width=$infoarray['width'];
@@ -182,5 +185,8 @@ print '