$imageWidth ){ // images is portrait so set thumbnail width to 100px and calculate height keeping aspect ratio $thumbWidth = 100; $thumbHeight = floor( $imageHeight * ( 100 / $imageWidth ) ); $thumbPosition = "margin-top: -" . floor( ( $thumbHeight - 100 ) / 2 ) . "px; margin-left: 0"; } else { // image is landscape so set thumbnail height to 100px and calculate width keeping aspect ratio $thumbHeight = 100; $thumbWidth = floor( $imageWidth * ( 100 / $imageHeight ) ); $thumbPosition = "margin-top: 0; margin-left: -" . floor( ( $thumbWidth - 100 ) / 2 ) . "px"; } // END else if // verify if thumbnail exists, otherwise create it if ( !file_exists( $thumbnail ) ){ $createFromjpeg = imagecreatefromjpeg( $file ); $thumb_temp = imagecreatetruecolor( $thumbWidth, $thumbHeight ); imagecopyresized( $thumb_temp, $createFromjpeg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imageWidth, $imageHeight ); if ( !imagejpeg( $thumb_temp, $thumbnail ) ) echo "failed: ".$thumbnail.";;;;"; } // END if() // Create sub-array for this image // notice the key,value pair $imgListSubArray = array( LinkTo=>$file, ImageName=> $imageName, Datafilter=>$dataFilter, Thumbnail=>$thumbnail, Position=>$thumbPosition ); // Push this sub-array into main array $imgListArray array_push ( $imgListArray, $imgListSubArray ); } // END if() } // END foreach() unset($file); // destroy the reference after foreach() // END the loop ?> OponyLand.pl | Wulkanizacja z Bezpłatnym Dojazdem do Klienta | wymiana opon Poznań | Sprzedaż Używanych Części

Szybki Kontakt, Dzwoń:

  |      |

Galeria zdjęć


Kontakt z nami


telefon kontaktowy:

0795 00 65 65



napisz do nas e-mail:

info@oponyland.pl


OponyLand.pl
ul. Nizinna 17,
61-424 Poznań