Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Problem with full-sized photos  (Read 9842 times)

0 Members and 1 Guest are viewing this topic.

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Problem with full-sized photos
« on: June 06, 2010, 08:58:56 pm »

After I updated my Coppermine to the latest 1.5.4 a problem with full-sized photos appeared. Big photos (HQ, UHQ) aren't showed as they should. I attached a screenshot. You also can try http://gallery.heygaga.ru/displayimage.php?album=lasthits&cat=0&pid=1209#top_display_media [Edit Joachim] Warning: link not safe for work [/Edit]. As you can see, when the image is loading pop-up is big as it should, but when the photo is loaded pop-up becomes small. I don't like it and users also.
« Last Edit: June 07, 2010, 08:14:01 am by Joachim Müller »
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: Problem with full-sized photos
« Reply #1 on: June 06, 2010, 09:06:15 pm »

That is a browser function, not a coppermine issue.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #2 on: June 06, 2010, 09:09:15 pm »

That is a browser function, not a coppermine issue.
Why in all 1.4 galleries I didn't meet such problem, but in all 1.5 galleries it appears? I can see it and in Firefox, and in IE 8.
Logged

anna.

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 16
    • Canon Love
Re: Problem with full-sized photos
« Reply #3 on: June 06, 2010, 11:17:09 pm »

I have the same problem, it's not exactly a problem but in previous version the picture did show as big as it was a now it resizes and it's be confusing for users as they think the picture is small.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Problem with full-sized photos
« Reply #4 on: June 07, 2010, 08:12:13 am »

Uploading 1.880px × 3.000px images and not force-resizing them is not a bright idea and a waste of recources and band-width. I can't replicate your issues though - the browsers I have access to work exactly as expected.
Please repect board rules in the future:
  • @Daniil: always post a warning with the link to your gallery if it contains adult content, even if it is mild nudity or babe poses. I have edited your posting accordingly
  • @anna.: please respect board rules in the first place - posting a link to your gallery is mandatory. If your issue differs, don't hijack someone else's thread but start a thread of your own
Logged

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #5 on: June 07, 2010, 11:38:54 am »

Uploading 1.880px × 3.000px images and not force-resizing them is not a bright idea and a waste of recources and band-width. I can't replicate your issues though - the browsers I have access to work exactly as expected.
I want to say that if a person is clicking on the image, he wants to see a HQ and large image. And in Coppermine 1.5.4. pop-up opens full-sized photo and after it makes smaller. So, what's the sense of full-sized photos if they become like simple.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem with full-sized photos
« Reply #6 on: June 07, 2010, 12:28:12 pm »

in Coppermine 1.5.4. pop-up opens full-sized photo and after it makes smaller
I can confirm that behavior on your website, but not on my local testbed. Please upgrade to cpg1.5.6 and post the content of your theme.php, if any.
Logged

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #7 on: June 07, 2010, 01:11:32 pm »

I can confirm that behavior on your website, but not on my local testbed. Please upgrade to cpg1.5.6 and post the content of your theme.php, if any.

I upgraded to cpg1.5.6. The problem also appears. I've tried new curve theme, there this problem also is.

The content of theme.php in my theme:

<?php
define('THEME_IS_XHTML10_TRANSITIONAL',1);
?>


P.S. Have you tried to open big photos, not small?

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem with full-sized photos
« Reply #8 on: June 07, 2010, 01:56:54 pm »

Have you tried to open big photos, not small?
Yes. I just uploaded your picture to my gallery.

Enable Insert a transparent overlay to minimize image theft and your problem should be solved.
Logged

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #9 on: June 07, 2010, 02:00:17 pm »

Yes. I just uploaded your picture to my gallery.

Enable Insert a transparent overlay to minimize image theft and your problem should be solved.

Yes. Now it's ok. But a lot of people use photos from my gallery. What should they do now?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem with full-sized photos
« Reply #10 on: June 07, 2010, 02:19:30 pm »

Have a look at the function theme_display_fullsize_pic and adjust it to your needs (copy it to your theme.php file). Compare the content of $fullsize_html in case of enabled/disabled overlay.
Logged

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #11 on: June 07, 2010, 02:27:52 pm »

Have a look at the function theme_display_fullsize_pic and adjust it to your needs (copy it to your theme.php file). Compare the content of $fullsize_html in case of enabled/disabled overlay.

Which files should I edit?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Logged

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #13 on: June 07, 2010, 02:59:22 pm »

http://gallery.heygaga.ru/themes/classic/theme.php
i've added theme_display_fullsize_pic to this file and Gallery doesn't open. Just an error is on the screen. Please, say what exactly should i add to theme.php file.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem with full-sized photos
« Reply #14 on: June 07, 2010, 03:04:10 pm »

Copy the whole function theme_display_fullsize_pic from themes/sample/theme.php to themes/your_theme/theme.php. Please also use the board search, as this has been asked so many times before.
Logged

Daniil

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Problem with full-sized photos
« Reply #15 on: June 07, 2010, 03:15:27 pm »

Copy the whole function theme_display_fullsize_pic from themes/sample/theme.php to themes/your_theme/theme.php. Please also use the board search, as this has been asked so many times before.

I've added this to theme.php and there's no difference(((

Code: [Select]
/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - START
******************************************************************************/
// Display the full size image
function theme_display_fullsize_pic()
{
    global $CONFIG, $THEME_DIR, $FORBIDDEN_SET, $LINEBREAK, $pid;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    $superCage = Inspekt::makeSuperCage();

    if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
        printf($lang_errors['login_needed'],'','','','');
        die();
    } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
        printf($lang_errors['access_intermediate_only'],'','','','');
        die();
    }
    if ($superCage->get->keyExists('picfile')) {
        if (!GALLERY_ADMIN_MODE) {
            cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
        }
        //$picfile = $_GET['picfile'];
        //$picfile = $superCage->get->getPath('picfile'); // doesn't work with HTML entities
        $matches = $superCage->get->getMatched('picfile', '/^[0-9A-Za-z\/_.-]+$/');
        $picfile = $matches[0];
        $picname = $CONFIG['fullpath'] . $picfile;
        $imagesize = @getimagesize($picname);
        $imagedata = array('name' => $picfile, 'path' => path2url($picname), 'geometry' => $imagesize[3]);
    } elseif ($pid) {
        $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} AS p " . "WHERE pid='$pid' $FORBIDDEN_SET";
        $result = cpg_db_query($sql);
        if (!mysql_num_rows($result)) {
            cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
        }
        $row = mysql_fetch_assoc($result);
        $pic_url = get_pic_url($row, 'fullsize');
        $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
        $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
    }
    if ((!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) || (USER_ID && USER_ACCESS_LEVEL <= 2)) {
        // adjust the size of the window if we don't have to catter for a full-size pop-up, but only a text message
        $row['pwidth'] = 200;
        $row['pheight'] = 100;
    }

    $charset = ($CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset']);
    $fullsize_html = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=$charset" />
        <title>{$CONFIG['gallery_name']}: {$lang_fullsize_popup['click_to_close']}</title>
        <style type="text/css">
            body { margin: 0; padding: 0; background-color: gray; }
            img { margin:0; padding:0; border:0; }
            #content { margin:0 auto; padding:0; border:0; }
            table { border:0; width:{$row['pwidth']}px; height:{$row['pheight']}px; border-collapse:collapse}
            td { vertical-align: middle; text-align:center; }
        </style>

        <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
        <script type="text/javascript" src="js/jquery.dimensions.pack.js"></script>
        <script type="text/javascript" src="js/displayimage.fullsize.js"></script>
    </head>
    <body style="margin:0px; padding:0px; background-color: gray;">

EOT;
    if ($CONFIG['transparent_overlay'] == 1) {
        $fullsize_html .= <<<EOT
        <table cellpadding="0" cellspacing="0" align="center" style="padding:0px;">
            <tr>

EOT;
        $fullsize_html .=  '<td align="center" valign="middle" background="' . htmlspecialchars($imagedata['path']) . '" ' . $imagedata['geometry'] . ' class="image">';
        $fullsize_html .=  '<div id="content">';
        $fullsize_html .=  '<a href="javascript: window.close()" style="border:none"><img src="images/image.gif?id='
                . floor(rand()*1000+rand())
                . '&amp;fullsize=yes" '
                . $imagedata['geometry']
                . ' alt="'
                . htmlspecialchars($imagedata['name'])
                . '" title="'
                . htmlspecialchars($imagedata['name'])
                . $LINEBREAK . $lang_fullsize_popup['click_to_close']
                . '" /></a><br />' . $LINEBREAK;
        $fullsize_html .=  <<<EOT
                    </div>
                </td>
            </tr>
        </table>

EOT;
    } else {
        $fullsize_html .=  '        <div id="content">'.$LINEBREAK;
        $fullsize_html .=  '<a href="javascript: window.close()"><img src="'
        . htmlspecialchars($imagedata['path']) . '" '
        . $imagedata['geometry']
        . 'id="fullsize_image" alt="'
        . htmlspecialchars($imagedata['name'])
        . '" title="'
        . htmlspecialchars($imagedata['name'])
        . $LINEBREAK . $lang_fullsize_popup['click_to_close']
        . '" /></a><br />' . $LINEBREAK
        . '        </div>'.$LINEBREAK;
    }
    $fullsize_html .= <<<EOT
  </body>
</html>

EOT;

    $fullsize_html = CPGPluginAPI::filter('fullsize_html', $fullsize_html);
    echo $fullsize_html;
}
/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - END
******************************************************************************/

Now my theme.php looks like:

Code: [Select]
<?php
define
('THEME_IS_XHTML10_TRANSITIONAL',1);


/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - START
******************************************************************************/
// Display the full size image
function theme_display_fullsize_pic()
{
    global 
$CONFIG$THEME_DIR$FORBIDDEN_SET$LINEBREAK$pid;
    global 
$lang_errors$lang_fullsize_popup$lang_charset;

    
$superCage Inspekt::makeSuperCage();

    if (!
USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
        
printf($lang_errors['login_needed'],'','','','');
        die();
    } elseif (
USER_ID && USER_ACCESS_LEVEL <= 2) {
        
printf($lang_errors['access_intermediate_only'],'','','','');
        die();
    }
    if (
$superCage->get->keyExists('picfile')) {
        if (!
GALLERY_ADMIN_MODE) {
            
cpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
        }
        
//$picfile = $_GET['picfile'];
        //$picfile = $superCage->get->getPath('picfile'); // doesn't work with HTML entities
        
$matches $superCage->get->getMatched('picfile''/^[0-9A-Za-z\/_.-]+$/');
        
$picfile $matches[0];
        
$picname $CONFIG['fullpath'] . $picfile;
        
$imagesize = @getimagesize($picname);
        
$imagedata = array('name' => $picfile'path' => path2url($picname), 'geometry' => $imagesize[3]);
    } elseif (
$pid) {
        
$sql "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} AS p " "WHERE pid='$pid$FORBIDDEN_SET";
        
$result cpg_db_query($sql);
        if (!
mysql_num_rows($result)) {
            
cpg_die(ERROR$lang_errors['non_exist_ap'], __FILE____LINE__);
        }
        
$row mysql_fetch_assoc($result);
        
$pic_url get_pic_url($row'fullsize');
        
$geom 'width="' $row['pwidth'] . '" height="' $row['pheight'] . '"';
        
$imagedata = array('name' => $row['filename'], 'path' => $pic_url'geometry' => $geom);
    }
    if ((!
USER_ID && $CONFIG['allow_unlogged_access'] <= 2) || (USER_ID && USER_ACCESS_LEVEL <= 2)) {
        
// adjust the size of the window if we don't have to catter for a full-size pop-up, but only a text message
        
$row['pwidth'] = 200;
        
$row['pheight'] = 100;
    }

    
$charset = ($CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset']);
    
$fullsize_html = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=
$charset" />
        <title>
{$CONFIG['gallery_name']}{$lang_fullsize_popup['click_to_close']}</title>
        <style type="text/css">
            body { margin: 0; padding: 0; background-color: gray; }
            img { margin:0; padding:0; border:0; }
            #content { margin:0 auto; padding:0; border:0; }
            table { border:0; width:
{$row['pwidth']}px; height:{$row['pheight']}px; border-collapse:collapse}
            td { vertical-align: middle; text-align:center; }
        </style>

        <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
        <script type="text/javascript" src="js/jquery.dimensions.pack.js"></script>
        <script type="text/javascript" src="js/displayimage.fullsize.js"></script>
    </head>
    <body style="margin:0px; padding:0px; background-color: gray;">

EOT;
    if (
$CONFIG['transparent_overlay'] == 1) {
        
$fullsize_html .= <<<EOT
        <table cellpadding="0" cellspacing="0" align="center" style="padding:0px;">
            <tr>

EOT;
        
$fullsize_html .=  '<td align="center" valign="middle" background="' htmlspecialchars($imagedata['path']) . '" ' $imagedata['geometry'] . ' class="image">';
        
$fullsize_html .=  '<div id="content">';
        
$fullsize_html .=  '<a href="javascript: window.close()" style="border:none"><img src="images/image.gif?id='
                
floor(rand()*1000+rand())
                . 
'&amp;fullsize=yes" '
                
$imagedata['geometry']
                . 
' alt="'
                
htmlspecialchars($imagedata['name'])
                . 
'" title="'
                
htmlspecialchars($imagedata['name'])
                . 
$LINEBREAK $lang_fullsize_popup['click_to_close']
                . 
'" /></a><br />' $LINEBREAK;
        
$fullsize_html .=  <<<EOT
                    </div>
                </td>
            </tr>
        </table>

EOT;
    } else {
        
$fullsize_html .=  '        <div id="content">'.$LINEBREAK;
        
$fullsize_html .=  '<a href="javascript: window.close()"><img src="'
        
htmlspecialchars($imagedata['path']) . '" '
        
$imagedata['geometry']
        . 
'id="fullsize_image" alt="'
        
htmlspecialchars($imagedata['name'])
        . 
'" title="'
        
htmlspecialchars($imagedata['name'])
        . 
$LINEBREAK $lang_fullsize_popup['click_to_close']
        . 
'" /></a><br />' $LINEBREAK
        
'        </div>'.$LINEBREAK;
    }
    
$fullsize_html .= <<<EOT
  </body>
</html>

EOT;

    
$fullsize_html CPGPluginAPI::filter('fullsize_html'$fullsize_html);
    echo 
$fullsize_html;
}
/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - END
******************************************************************************/

?>


Why don't I see the result?(((
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Problem with full-sized photos
« Reply #16 on: June 07, 2010, 03:26:06 pm »

Why don't I see the result?
Read my instructions carefully!
adjust it to your needs [..] Compare the content of $fullsize_html in case of enabled/disabled overlay
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 20 queries.