3 replies [Last post]
google@ildw.com's picture
Offline
Enthusiast
Houston, Texas Jeahhhh!
Last seen: 2 years 45 weeks ago
Houston, Texas Jeahhhh!
Timezone: GMT-5
Joined: 2006-10-17
Posts: 117
Points: 25

Good morning,
I have been struggling with this issue for a while, maybe you can point me in the right direction?

when I do a gallery of images, I have thumbnails, I have to resize them manually until they get lets say 300 by 200, so every picture I have to resize manually for this ratio, if I do a batch some will resize 300 by 170 and they won't look nice on the layout.

my question, is there a way to clip these images using css so if they are a little bigger that will be fine? they will get cropped using css?

or is there another method?

Thank you

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 19 hours 25 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9742
Points: 3821

Good afternoon (I'm not a morning person)

I'd suggest you read this. There is a potload of info, and from personal experience these methods work better than any other.

If quality matters, you should crop to the most important or informative portion of the image in the desired aspect ratio first, then reduce.

For css solutions, see the clip property and the background-size property

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 19 hours 25 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9742
Points: 3821

Window dumps

attached

AttachmentSize
chrome-small.gif 61.4 KB
ff-small.gif 62 KB

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

ramcom
ramcom's picture
Offline
Regular
Belgium
Last seen: 2 years 45 weeks ago
Belgium
Timezone: GMT+2
Joined: 2016-09-28
Posts: 13
Points: 16

i think you have to read

i think you have to read first image properties (width height) by javascript if necesarry is for resize?