NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

Post a reply

Write your message and submit
Options
Humanity test

What is one + five?

Go back

Topic review (newest first)

rainbow
07-08-2006 21:40:01

Waccoon wrote:

Couple things:

echo 'Image Dimensions: ',$imagewidth.' x '

You must always use the period to concatenate strings.  You can't use a comma.

Second, if the image is 256 or smaller AND a pr0n image, it won't be linked.  Here's an update.  I assume you've already set $imagewidth, $imageheight, and $size in the right place.

Code:

<?php

// Do 256
if ($jpgcompression == 'yes') {
    $a_image = $OPpics.'/'.$outerrow['PIC_ID'].'.jpg';
} else {
    $a_image = $OPpics.'/'.$outerrow['PIC_ID'].'.png';
}
$d_image = $a_image;

$d_link = FALSE;
$d_width = '';
if (!strstr($usrflags, 'X') && $outerrow['adult'] == 1) {
    $d_image = 'pr0n.png';
    $d_width = 'width="100"';
    $d_link = TRUE;
}
if ($imagewidth > 256) {
    $d_width = 'width="256"';
    $d_link = TRUE;
}
?>
    <acronym title="<?="Image Dimensions: {$imagewidth}&times;{$imageheight}, File Size: {$size}KB";?>">
<? if ($d_link) { ?>
        <a href="<?=$a_image?>"><img src="<?=$d_image?>" <?=$d_width?> border="0" /></a>
<? } else { ?>
        <img src="<?=$d_image?>" <?=$d_width?> border="0" />
<? } ?>
    </acronym>

Thanks for helping me out. I finally got the images to resize to the limit without using thumbnails. ^^

Waccoon
07-08-2006 19:20:48

Couple things:

echo 'Image Dimensions: ',$imagewidth.' x '

You must always use the period to concatenate strings.  You can't use a comma.

Second, if the image is 256 or smaller AND a pr0n image, it won't be linked.  Here's an update.  I assume you've already set $imagewidth, $imageheight, and $size in the right place.

Code:

<?php

// Do 256
if ($jpgcompression == 'yes') {
    $a_image = $OPpics.'/'.$outerrow['PIC_ID'].'.jpg';
} else {
    $a_image = $OPpics.'/'.$outerrow['PIC_ID'].'.png';
}
$d_image = $a_image;

$d_link = FALSE;
$d_width = '';
if (!strstr($usrflags, 'X') && $outerrow['adult'] == 1) {
    $d_image = 'pr0n.png';
    $d_width = 'width="100"';
    $d_link = TRUE;
}
if ($imagewidth > 256) {
    $d_width = 'width="256"';
    $d_link = TRUE;
}
?>
    <acronym title="<?="Image Dimensions: {$imagewidth}&times;{$imageheight}, File Size: {$size}KB";?>">
<? if ($d_link) { ?>
        <a href="<?=$a_image?>"><img src="<?=$d_image?>" <?=$d_width?> border="0" /></a>
<? } else { ?>
        <img src="<?=$d_image?>" <?=$d_width?> border="0" />
<? } ?>
    </acronym>
rainbow
07-06-2006 21:07:47

For quite sometime, I've been wanting to resize the images that are bigger than 256 x 256 to 256 pixels in width (hence the width value is set to 256) and with the preview "pr0n.png" image being displayed, the size of the pr0n.png image gets resized to 256 x 256 as well.

Here's the code that I've been trying to fix but I can't seem to do it right:

<? if (($imagewidth) <= 256) { ?>
        <acronym title="<? echo 'Image Dimensions: ',$imagewidth.' x ',$imageheight.', ','File Size: ',$size.' KB'; ?>"><img src="<?
            if (!strstr($usrflags, 'X') && $outerrow['adult'] == 1) {
                echo 'pr0n.png';
            } else {
                if($jpgcompression == 'yes') {
                    echo $OPpics.'/'.$outerrow['PIC_ID'].'.jpg';
                } else {
                    echo $OPpics.'/'.$outerrow['PIC_ID'].'.png';
                }
            }
        ?>" border="0" /></acronym>
<? } else { ?>
    <acronym title="<? echo 'Image Dimensions: ',$imagewidth.' x ',$imageheight.', ','File Size: ',$size.' KB'; ?>"><a href="<?=$OPpics?>/<?=$outerrow['PIC_ID']?>.png"><img src="<?
        if($jpgcompression == 'yes') {
            echo $OPpics.'/'.$outerrow['PIC_ID'].'.jpg';
        } else {
            echo $OPpics.'/'.$outerrow['PIC_ID'].'.png';
        }
        ?>" width="256" border="0" /></acronym>
            <? if (!strstr($usrflags, 'X') && $outerrow['adult'] == 1) { ?>
                <? echo 'pr0n.png'; ?>
            <? } ?>
            ?>" width="100" border="0" />
        </a>
<? } ?>

I want to be able to resize the images that are larger than 256 x 256 to 256 pixels in width maximum without having to generate JPG thumbnails or stretch the drawing or stretching the "pron.png" image to 256 x 256. How can I do this?

I already made images smaller than 256 x 256 non-clickable though.

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB