Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thumb create wrong image #225

Open
webdev2009 opened this issue Aug 17, 2024 · 0 comments
Open

thumb create wrong image #225

webdev2009 opened this issue Aug 17, 2024 · 0 comments

Comments

@webdev2009
Copy link

Hi James;
thanks for the for the great script , I had use it some years ego.
I downloaded the latest version from https://github.com/JamesHeinrich/phpThumb .

I think the last version of the script has issues.

when i run my php script

require_once('phpthumb.class.php');

$phpThumb = new phpThumb();
$phpThumb->resetObject();

$thumbnail_width = 1000;
$thumbnail_hight = 1000;

$phpThumb->setParameter('w', $thumbnail_width);
$phpThumb->setParameter('h', $thumbnail_hight);
$phpThumb->setParameter('bg', 'FFFFFF');
$phpThumb->setParameter('far', '1');
$phpThumb->setParameter('aoe', '0');

$phpThumb->setParameter('f', 'jpeg');

$phpThumb->setSourceData(file_get_contents('https://lightingzone.xologic.com/vendors/10/large/1049-677.jpg'));

$output_filename = '1049-677_HH5H.jpg';

if ($phpThumb->GenerateThumbnail()) { // this line is VERY important, do not remove it!
    if ($phpThumb->RenderToFile($output_filename)) {
        echo 'Successfully rendered to "'.$output_filename.'"';
    } else {
        echo 'Failed: #1 <pre>'.implode("\n\n", $phpThumb->debugmessages).'</pre>';
    }
} else {
    echo 'Failed: #2 <pre>'.$phpThumb->fatalerror."\n\n".implode("\n\n", $phpThumb->debugmessages).'</pre>';
}

it run good . no errors , how ever the new image is not the same ar original. sometime it looks like a 'Negative Film Picture' or the colors are not the same. . please help. Thanks

1049-677_HH5H
1049-677-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant