Black background in thumbs and wherever, MorfeoShow Gallery

  • No avatar image
  • Halison
  • Posts: 1
  • Joined: Wed Jun 24, 2009 3:35 am

Poston Wed Jun 24, 2009 5:45 am Halison said:

Hello everyone,

My name is Halison, (details in my page), I had fixed one bug in gallery MorfeoShow 1.2.0, the bug was when upload images, the out file image be with a black background,

I just add one "if" in upload.php

around line 757, change this 'if'
Code: Select all
   //if the width is smaller make the width forced and the height the same ratio

         if($src_width <= $src_height)

         {

            $new_width = $forcedwidth1;

            $new_height_temp = ($forcedwidth1/$src_width)*$src_height;
            
            // fix background black when diference is less -  halison.net
            if($new_height_temp <= $forcedheight1) {
            
               $diferent_he =  $forcedheight1-$new_height_temp;
               $new_height = $new_height_temp+$diferent_he;
            }
            else {
                  $new_height = $new_height_temp;
            }
            

         }

         //if the height is smaller make the height forced and the width the same ratio

         else

         {

            $new_height = $forcedheight1;

            $new_width_temp = ($new_height/$src_height)*$src_width; 
            
            // fix background black when diference is less -  halison.net
            if($new_width_temp <= $forcedwidth1) {
            
               $diferent_wid =  $forcedwidth1-$new_width_temp;
               $new_width = $new_width_temp+$diferent_wid;
            }
            else {
                  $new_width = $new_width_temp;
            }

         }


hope help

Halison
http://halison.net

Return to Extensions

Who is online

Users browsing this forum: No registered users and 1 guest