Author Topic: Restrict thumbnail image size?  (Read 6383 times)

0 Members and 1 Guest are viewing this topic.

Offline Radical3

  • Pre-Newbie
  • Posts: 4
    • View Profile
Restrict thumbnail image size?
« on: August 25, 2008, 11:47:53 PM »
in the backend you set set the thumbnail image size however, when a user uploads a thumbnail for an image and its too large, 4images still accepts it?

is there a way to restrict size , or resize thumbnails on upload??

basically where can i go to force all thumbnails to one size?
« Last Edit: August 26, 2008, 12:43:40 AM by Radical3 »

Offline Radical3

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: Restrict thumbnail image size?
« Reply #1 on: August 26, 2008, 01:44:47 AM »
SOLVED MY OWN PROBLEM

FOR PEOPLE USING 4IMAGES AS A VIDEO SITE,  THIS IS CRUCIAL. LET PEOPLE UPLOAD THE VIDEOS AND THE THUMBNAILS
THEN USE CSS TO RESIZE THE THUMBNAILS, EASY.


files to be edited
templates/{yourtemplate}/thumbnail_bit.html
templates/{yourtemplate}/random_image.html ----- if you still use the random image
templates/{yourtemplate}/style.css

BACKUP YOUR STUFF

open up thumbnail_bit  and look for
Code: [Select]
{thumbnail}
Now wrap it in div tags like this
Code: [Select]
<div>{thumbnail}</div>
give the div an id of anything you want, im gonna call this "resize"
Code: [Select]
<div id="resize">{thumbnail}</div>
go to random_image.html and look for {thumbnail} then place it in the same div id as before
Code: [Select]
<div id="resize">{thumbnail}</div>
save and close the files, now go to style.css and add this at the bottom

Code: [Select]
#resize {
height:135px;
overflow: hidden;
width: 135px;

}#resize img {
height:135px;
overflow: hidden;
width: 135px;
max-height:135px;
max-width:135;
}


change your height and width change it to whatever you use.
max-height, max-width(the last two lines of css are crucial) this is the part that does the resize.

ive tested this in :
firefox
safari
opera
IE6
works perfectly, 

WARNING: this hack will not resize porportionally, it is not gd2 or imagemagick , its only css, it will resize every thumbnail you have, BUT NOT PERMANENTLY.
« Last Edit: August 31, 2008, 12:13:45 AM by Radical3 »