Keyword

Browse vs Browse server

  • jeanette hustad
  • jeanette hustad's Avatar Topic Author
  • Offline
  • Senior Member
More
14 years 6 months ago #80190 by jeanette hustad
Replied by jeanette hustad on topic Browse vs Browse server
Any news about this one ?

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #80191 by Lahmizzar
Replied by Lahmizzar on topic Browse vs Browse server
No Sorry, i'm looking for it too..

But i found a small Programm to fit image size... its very easy to use for much pictures... just drag and drop put in image size, and all pictures were fit

if anyone interested, here is the link: www.traumflieger.de/desktop/onlinepicture/index.php

lahmizzar
_________

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80192 by Matthew Brown
Replied by Matthew Brown on topic Browse vs Browse server
Hi All,

Is there any news on this?
I'm using k2 v2.3.
The upload for an item works fine, but when browsing for an image on the server, I select the image, it populates the form field, but when i save, it doesn't save the image i've selected from the server?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80193 by Willie
Replied by Willie on topic Browse vs Browse server
Hi, in my case I was experiencing looong wait times and finally an error upon maximum execution time limit reached. I've looked at the code and analyzed what was being carried out, and it seemed that the issue happens when a small image has to be resized to a bigger size to match the XL, L, M sizes and so on.

So I edited the administrator/com_k2/models/item.php file, to ensure that the images are resized when they are bigger than the target size, and just save a copy under the jpg quality, without resizing, on any other case.

It worked okay after that. Although I can see that there are other alternatives of coding that would produce image resizing at a fraction of the time -phase 2 I guess...

The lines you have to edit are as follows:

//Original image
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'src';
$handle->image_convert = 'jpg';
$handle->jpeg_quality = 100;
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = md5("Image".$row->id);
$handle->Process($savepath);

$filename = $handle->file_dst_name_body;
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache';

$src_x = $handle->image_src_x;

//XLarge image
if (JRequest::getInt('itemImageXL')) {
$imageWidth = JRequest::getInt('itemImageXL');
} else {
$imageWidth = $params->get('itemImageXL', '800');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}

$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XL';
$handle->Process($savepath);

//Large image
if (JRequest::getInt('itemImageL')) {
$imageWidth = JRequest::getInt('itemImageL');
} else {
$imageWidth = $params->get('itemImageL', '600');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_L';
$handle->Process($savepath);

//Medium image
if (JRequest::getInt('itemImageM')) {
$imageWidth = JRequest::getInt('itemImageM');
} else {
$imageWidth = $params->get('itemImageM', '400');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_M';
$handle->Process($savepath);

//Small image
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
} else {
$imageWidth = $params->get('itemImageS', '200');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_S';
$handle->Process($savepath);

//XSmall image
if (JRequest::getInt('itemImageXS')) {
$imageWidth = JRequest::getInt('itemImageXS');
} else {
$imageWidth = $params->get('itemImageXS', '100');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XS';
$handle->Process($savepath);

//Generic image
$imageWidth = $params->get('itemImageGeneric', '300');
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_Generic';
$handle->Process($savepath);

Best regards,
Willie

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum