Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Image crop. You can pass the parameters in the url to get your desired output image size like this <code>image.php?src=img/random.jpg&amp;w=300&amp;h=200</code></p> <pre><code>&lt;?php header("Content-type: image/jpeg"); $image = imagecreatefromjpeg($_GET['src']); $thumb_width = $_GET['w']; $thumb_height = $_GET['h']; $width = imagesx($image); $height = imagesy($image); $original_aspect = $width / $height; $thumb_aspect = $thumb_width / $thumb_height; if($original_aspect &gt;= $thumb_aspect) { // If image is wider than thumbnail (in aspect ratio sense) $new_height = $thumb_height; $new_width = $width / ($height / $thumb_height); } else { // If the thumbnail is wider than the image $new_width = $thumb_width; $new_height = $height / ($width / $thumb_width); } $thumb = imagecreatetruecolor($thumb_width, $thumb_height); // Resize and crop imagecopyresampled($thumb, $image, 0 - ($new_width - $thumb_width) / 2, // Center the image horizontally 0 - ($new_height - $thumb_height) / 2, // Center the image vertically 0, 0, $new_width, $new_height, $width, $height); imagejpeg($thumb); ?&gt; </code></pre> <p>In terms of putting one image on the page at a time and browse through them use previous and next button. That would require some javascript to achieve that. </p> <p>There are many nice gallery that would display the image one at a time, and they already take care of the image resize issue. Take a look at <a href="http://www.1stwebdesigner.com/css/57-free-image-gallery-slideshow-and-lightbox-solutions/" rel="nofollow">HERE</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload