Jump to content

Images loosing sharpness in PHP swap image gallery


superkav

Recommended Posts

Hello All,

I created an Auto Dealership CMS for a friend of mine. One of the functionalities of it is an Image Gallery for the Cars he sells. How ever when he uploads some images (at around 300-400k) the sharpness on some of them are really bad.

Check the gallery out [url=http://lawtonfoley.ie/cardetails.php?carid=10]http://lawtonfoley.ie/cardetails.php?carid=10[/url]
The second image in the Mits Colt, the outline is all jaggedy. However he also uploads the images to another car site. Here you can see the same images only more focused. [url=http://carzone.ie/usedcars/index.cfm?fuseaction=car&carID=526624]http://carzone.ie/usedcars/index.cfm?fuseaction=car&carID=526624[/url]

What do i need to do to keep quality as the images resize.

Please note that I do not administrate this site. If i did i was obviously resize in photoshop before uploading. These images are being uploaded straight off a digital camera, image size approx 400k. The users are IT illiterate, and pretty lazy so they dont want to have to resize them themselves.

Is there a way of resizing while keeping quality as i upload using som GD library functions..

Any Help is greatly appreciated.
Regards
Superkav
Link to comment
Share on other sites

The reason this is occurring is because the images aren't being resized at all, they're just scaling down the proportions and displaying it...

If you right click the picture to see where it's being hosted and then open that location in a new window, you'll see the file hasn't been resized at all.  Look here:

http://lawtonfoley.ie/admin/carimages/1769742953/DSCF1001.JPG

You could use the GD library to resize and maintain quality, but you'd need to integrate the code with what you already have.

Regards
Huggie
Link to comment
Share on other sites

The reason this is occurring is because the images aren't being resized at all, they're just scaling down the proportions and displaying it...

If you right click the picture to see where it's being hosted and then open that location in a new window, you'll see the file hasn't been resized at all.  Look here:

http://lawtonfoley.ie/admin/carimages/1769742953/DSCF1001.JPG

You could use the GD library to resize and maintain quality, but you'd need to integrate the code with what you already have.

Regards
Huggie

Hi Huggie,

Thanks for response.. Yeah i realise that they are not resizing. are your familiar with GD and what functions to use. Ive never worked with them. Is there a class i can utilize
Link to comment
Share on other sites

I've used the GD library for a few things, yes.

You're after [url=http://uk.php.net/manual/en/function.imagecopyresampled.php]imagecopyresampled()[/url]

Although the description of this is [i]"Copy and resize [b]part[/b] of an image with resampling"[/i] you can provide the coordinates of the whole image.

There's also a very simple example in the manual on the page I've provided.

Regards
Huggie
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.