forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Daniil 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.
-
That is a browser function, not a coppermine issue.
-
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.
-
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.
-
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
-
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.
-
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.
-
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?
-
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.
-
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?
-
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.
-
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?
-
http://gallery.heygaga.ru/themes/classic/theme.php
-
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.
-
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.
-
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(((
/******************************************************************************
** 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())
. '&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:
<?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())
. '&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?(((
-
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