PDA

View Full Version : Large photo problem 2



Maurizio Nicoli
November 28, 2013, 01:04 AM
I have a problem with version 4.1 that did not exist in version 3.2.

When I insert pictures the system works well, automatically the thumbnail size but large photos have all the size of a rectangle where space is not occupied by the size of the file (in this case a vertical picture) is colored white (in my case black) when you go to open big in the lightbox gallery.
You can have the photo so large as the original one but the size set in the admin panel and above all without the rectangle?

I tried the file rlResize.class.php but I can not find the function that creates this rectangle ...

Attaching photos to make me understand better ...

------------
Mike F.

Did you try to do somethign with this code in rlResize ?

PHP Code:
/* create white background */
$white = imagecolorallocate($this->resResizedImage, 255, 255, 255);
imagefill($this->resResizedImage, 0, 0, $white);

------------------

Hi Mike,

I have not explained well, I apologize ...
Basically I want to get the photos to the proportions they have and not with a colored background.
Example: if a picture is large 800 x 600 px must remain with these proportions even if in admin panel I set the size of the photo in a large 1200 x 600 px, the system I should sate for the picture with the height but the width of 600 px must be automated so you do not give me the edge with colored background on the sides of the picture.
In default mode, the system creates a picture of me in height and 600 px 1200 px width of 200px with a white background where the side of the photo.


I hope I explained better.

thanks

Mike
November 28, 2013, 05:43 AM
Ok, im not sure that it will work honestly but let's try. With new client-side resizing it became more tricker

Go to libs/upload/upload.php find function create_scaled_image and code inside


$rlResize -> resize( $config['img_crop_module'] || $options['force_crop'] ? $new_file_path : $file_path, $new_file_path, 'C', array($options['max_width'], $options['max_height']), $options['force_crop'], $options['watermark'] );


change to



$rlResize -> resize( $config['img_crop_module'] || $options['force_crop'] ? $new_file_path : $file_path, $new_file_path, 'W', array($options['max_width'], $options['max_height']), $options['force_crop'], $options['watermark'] );


OR


$rlResize -> resize( $config['img_crop_module'] || $options['force_crop'] ? $new_file_path : $file_path, $new_file_path, 'H', array($options['max_width'], $options['max_height']), $options['force_crop'], $options['watermark'] );


C means resize to custom height-width, W to width only and i think its what you need.

If result not good, provide me with login details (ftp, site, account, and image:) better in ticket or pm i will look into it

Maurizio Nicoli
November 28, 2013, 12:43 PM
Hi,

I have attached 3 images.
The photo with the name of 800x600 is ok since I have set the standard size of the photos in the admin panel 800 x 600 px.
The photo with the name of 600x800 as you can see when it is loaded by the system adds a white background color to the picture "Large" picture and to the "Original" picture and I do not want!!!.
I just need the picture without being added to the background.
The photo with the name of 800x400 has the background above and below because it is 200 pixels lower than what is set in the admin panel.
Can you show me how to do that this does not happen when I upload photos?
This to me is very important, so, sorry if I insist.
Thanks

Mike
November 29, 2013, 06:33 AM
Hi again, what is your version?

please pm me ftp login details if possible, i will try to do right on your site.

Logic seems following if width more than height resize by width, otherwise resize by height

also disable white color filling

Maurizio Nicoli
November 29, 2013, 04:33 PM
Hi Mike,

I'm working on localhost ....
How do I disable the white color filling?

Thanks

Maurizio Nicoli
November 29, 2013, 10:44 PM
Hi Mike,

I wrote to you in private. Have you received?

Maurizio Nicoli

Mike
December 5, 2013, 10:13 AM
Hi Maurizio,

Yes i have received your message and replied back.