Search…

X3 Photo Gallery Support Forums

Search…
 
h_razack
Topic Author
Posts: 8
Joined: 29 Sep 2009, 13:31

Cropping thumbnails in different position

24 Nov 2009, 13:00

Hi,

I was wondering whether there was a way to change how the thumbnails are cropped.

I have a set of portrait images, with people posing standing, and their heads are cut off in the thumbnails, which looks rather strange.

Is there a way to crop the images from the top, rather than in the center? (I don't think it's feasible in the options, but could you please point me where in the php code this might be changed?)

Thanks!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

25 Nov 2009, 11:37

Yea, thats a little difficult and cant be set from the admin. Usually we recommend either creating thumbnails manually(from your dektop), or using "scaletobox" scaling method for these thumbnails so that they are not cropped.

You could edit the file imagevue/include/ivImage.class.php - I believe the code that positions the crop, is here:
Code
	function crop($width, $height)
	{
		$x = floor(($this->imageinfo['width'] - $width) / 2);
		$y = floor(($this->imageinfo['height'] - $height) / 2);
Just from the top of my head, I am guessing you could try setting "$y = 0" to get it crop from the top, but dont take my word for it. Be careful, and make sure you make a backup before editing.
 
h_razack
Topic Author
Posts: 8
Joined: 29 Sep 2009, 13:31

25 Nov 2009, 13:19

Thanks a lot for your reply. I'll try that!