Author |
Message |
07/11/2007 15:49:43
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
When users post a picture size widthxhight, no matter what size. I want to get control of the picture went people click on it. I would like to resize the image like 600x500, and I don't to display the whole image size like 2000x2555. It's too big.
I know I can control people to upload picture, but I want then to feel free to upload any picture. I just want to resize the picture went they click on it.
Help any one please,
Thanks,
|
|
07/11/2007 15:59:30
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Yo have two options. Physically resize the image on upload if it's to big or use HTML to resize the image in the browser.
There is a third option and I may take a look at writing that mod for AG.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
07/11/2007 16:15:58
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
Carbonize wrote:Yo have two options. Physically resize the image on upload if it's to big or use HTML to resize the image in the browser.
There is a third option and I may take a look at writing that mod for AG.
That's what I want to do, I want to resize it manually, but I don't know what file is the pop up, so I can make the change. Do you know the file?
I found the file, it a js function, I played around with and i realized that the original pic need to resized, the same way they rename it, and get a small vesion of the original. I keep looking.
|
|
07/11/2007 17:57:54
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Just right click on it in the pop up window and select properties.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
07/11/2007 20:23:30
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
Carbonize wrote:Just right click on it in the pop up window and select properties.
Yea, but there is nothing that I can do because that function is calling the original image with the original size, and that what I want, I want resize the original. Any Idea?
|
|
07/11/2007 20:27:28
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
lasclavellinas wrote:
Carbonize wrote:Just right click on it in the pop up window and select properties.
Yea, but there is nothing that I can do because that function is calling the original image with the original size, and that what I want, I want resize the original. Any Idea?
This is the function that need to be changed but I don;t where: from file image.class.php
function create_thumbnail($source,$destination='') {
$img_filesize = (file_exists("$source")) ? filesize("$source") : false;
$destination = trim($destination);
if (strstr($destination, "/") || strstr($destination, "\\")) {
$new_file = $destination;
} elseif ($destination=='') {
$new_file = $this->destdir."/".$this->prefix.basename($source);
} else {
$new_file = $this->destdir."/".$this->prefix.$destination;
}
if (!$img_filesize || $img_filesize <= $this->min_filesize) {
return false;
}
$size = GetImageSize("$source");
$new_size = $this->get_img_size_format($size[0],$size[1]);
if ($this->is_imagick()) {
if (is_array($size) && count($size)>0) {
exec($this->imagick." -quality 90 -antialias -scale $new_size[0]x$new_size[1] $source $new_file");
}
} else {
$type = "$size[2]";
if (isset($this->supported_types["$type"])) {
switch ($type) {
case "1" :
$im = ImageCreateFromGIF("$source");
if (function_exists("imagecreatetruecolor")) {
$new_im = imagecreatetruecolor($new_size[0],$new_size[1]);
imagecopyresampled($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
} else {
$new_im = ImageCreate($new_size[0],$new_size[1]);
ImageCopyResized($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
}
ImageGIF($new_im,$new_file);
break;
case "2" :
$im = ImageCreateFromJPEG("$source");
if (function_exists("imagecreatetruecolor")) {
$new_im = imagecreatetruecolor($new_size[0],$new_size[1]);
imagecopyresampled($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
} else {
$new_im = ImageCreate($new_size[0],$new_size[1]);
ImageCopyResized($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
}
ImageJPEG($new_im,$new_file,90);
break;
case "3" :
$im = ImageCreateFromPNG("$source");
if (function_exists("imagecreatetruecolor")) {
$new_im = imagecreatetruecolor($new_size[0],$new_size[1]);
imagecopyresampled($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
} else {
$new_im = ImageCreate($new_size[0],$new_size[1]);
ImageCopyResized($new_im,$im,0,0,0,0,$new_size[0],$new_size[1],$size[0],$size[1]);
}
ImagePNG($new_im,$new_file);
break;
}
}
}
return (file_exists("$new_file")) ? true : false;
}
|
|
07/11/2007 21:54:31
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Question is would you want the image resized
1 - Physically when the image is uploaded
2 - By HTML when the image is viewed
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
07/11/2007 22:37:50
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
Carbonize wrote:Question is would you want the image resized
1 - Physically when the image is uploaded
2 - By HTML when the image is viewed
I guess:
By HTML when the image is viewed
It should be the same by
Physically when the image is uploaded
when the image is viewed, yeap.
|
|
07/11/2007 22:55:45
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
lasclavellinas wrote:
Carbonize wrote:Question is would you want the image resized
1 - Physically when the image is uploaded
2 - By HTML when the image is viewed
I guess:
By HTML when the image is viewed
It should be the same by
Physically when the image is uploaded
when the image is viewed, yeap.
I think this file need to be modified user_pic.php
<a href="javascript:gb_picture('$row[p_filename]',$row[width],$row[height])"><img src="$GB_PG[base_url]/$GB_UPLOAD/$row[p_filename]" align="left" border="0" $new_img_size[2]></a>
where: $row[p_filename]',$row[width],$row[height] are the size of the original file.
May be some condition will take care it?
|
|
07/11/2007 23:07:27
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
What I am saying is you can have PHP physically resize the picture when it is uploaded or you can just have the persons web browser resize it by putting the desired size into the img tag. I just need to know which so I can write the mod although the HTML method is probably the easiest.
I did write a mod for Lazarus that used Lytebox ( http://dolem.com ) to display the images. As this will resize images that are to large it may suit your needs.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
07/11/2007 23:12:58
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
Carbonize wrote:What I am saying is you can have PHP physically resize the picture when it is uploaded or you can just have the persons web browser resize it by putting the desired size into the img tag. I just need to know which so I can write the mod although the HTML method is probably the easiest.
I did write a mod for Lazarus that used Lytebox ( http://dolem.com ) to display the images. As this will resize images that are to large it may suit your needs.
What make your life easier would be fine with me.
I'll appreciated it.
Thanks
|
|
09/11/2007 14:52:42
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
lasclavellinas wrote:
Carbonize wrote:What I am saying is you can have PHP physically resize the picture when it is uploaded or you can just have the persons web browser resize it by putting the desired size into the img tag. I just need to know which so I can write the mod although the HTML method is probably the easiest.
I did write a mod for Lazarus that used Lytebox ( http://dolem.com ) to display the images. As this will resize images that are to large it may suit your needs.
What make your life easier would be fine with me.
I'll appreciated it.
Thanks
So, by when you will have it? let me know, thanks
|
|
09/11/2007 16:36:40
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Sorry got sidetracked by work. Email me to remind me.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
12/11/2007 22:47:09
|
lasclavellinas
Beginner
Joined: 26/10/2007 16:59:50
Messages: 20
Offline
|
Carbonize wrote:Sorry got sidetracked by work. Email me to remind me.
I had sent you an email, let me know
|
|
12/11/2007 23:01:57
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
And I have replied twice. You not get them?
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
|