- if (preg_match(',\Wheight\s*=\s*.(\d+)([^"\']*),i', $s, $r)){
- if ($r[2] != '%') {
- $height = $r[1];
- if ($r[2] == 'cm') $height <<=6;
+ else {
+ // si la taille est en centimetre, estimer le pixel a 1/64 de cm
+ if (preg_match(',\Wwidth\s*=\s*.(\d+)([^"\']*),i', $s, $r)){
+ if ($r[2]!='%'){
+ $width = $r[1];
+ if ($r[2]=='cm') $width <<= 6;
+ }
+ }
+ if (preg_match(',\Wheight\s*=\s*.(\d+)([^"\']*),i', $s, $r)){
+ if ($r[2]!='%'){
+ $height = $r[1];
+ if ($r[2]=='cm') $height <<= 6;
+ }