Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Image re size (for thumbnails)

Featured Replies

OK, I am currently working on making an image gallery for my blog but I am having problems with resizing the photos for thumbnails. This is a script I have at the moment which I wrote using a tutorial.

 

<?
$p = $_GET['p'];
$w = $_GET['w'];
$h = $_GET['h'];

$ims = imagecreatefromjpeg("../gallery/images/$p");
$ow = imagesx($ims); $oh = imagesy($ims);
$imd = imagecreate($w,$h);
imagecopyresized($imd,$ims,0,0,0,0,$w,$h,$ow,$oh);
//imagecopyresampled($imd,$ims,$0,$0,0,0,$w,$h,$ow,$ oh);

header("Content-type: image/jpeg");
imagejpeg($imd);

?>

 

And then I am displaying them with the following HTML code

 

<img src=thumb.php?p=image.jpg&w=200&h=200>

 

However this doesn't work as I would like it too. The images colour is badly distorted (like there is a filter layer over it) and some of them don't even display.

 

Is there a better way I can do this? Preferably without GD, I don't think my host supports it.

  • Author

Here is a link to the page I have so far. http://www.borellus.com/gallery/ so you can look for yourself.

 

If you click the images it loads the origonal, as you can see the origonal files are fine.

 

 

PROBLEM SOLVED!

 

I was using imagecreate instead of imagecreatetruecolor.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.