Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 04:45 am EST
Geeklog Forums
keep unscaled image with gdlib
Status: offline
obione
Forum User
Newbie
Registered: 04/07/04
Posts: 8
does it have that segment of code?
i'm using gdlib to resize my images, and i set the keep_unscaled:image to 1, and it never kept it.
browsing thru upload.class.php, in the gdlib part, i did not see the segment of code present in imagemagick or netpbm.
with gdlib geeklog does not copy the original file. i had to copy that segment of code to be able to keep the original images...
was just a problem with my installation or is this right? there's no condition to see if i want to keep the unscaled image with gdlib?
Obi One
i'm using gdlib to resize my images, and i set the keep_unscaled:image to 1, and it never kept it.
browsing thru upload.class.php, in the gdlib part, i did not see the segment of code present in imagemagick or netpbm.
with gdlib geeklog does not copy the original file. i had to copy that segment of code to be able to keep the original images...
was just a problem with my installation or is this right? there's no condition to see if i want to keep the unscaled image with gdlib?
Obi One
11
11
Quote
Ken Jones
Anonymous
Quote by obione: does it have that segment of code?
...
Obi One
...
Obi One
Got the same Problem in GL 1.3.9. Had to copy the code by myself and now it works flawless! Can't be an installation problem, i think this piece of code just got lost somewhere in the woods of cvs maybe...
11
10
Quote
Ken Jones
Anonymous
If someone wan't to know how to implement this without crawling through the sourcecode, here my snippet to hack into upload.class.php:
Search for:
and insert in front of this line:
if ($this->_keepOriginalImage) {
$lFilename_large = substr_replace ($this->_getDestinationName(), '_original.', strrpos ($this->_getDestinationName (), '.'), 1);
$lFilename_large_complete = $this->_fileUploadDirectory
. '/' . $lFilename_large;
if (!copy ($filename, $lFilename_large_complete)) {
$this->_addError ("Couldn't copy $filename to $lFilename_large_complete. You'll need to remove both files.");
$this->printErrors ();
exit;
}
}
// Keep Original Image with GDLib -- Hack end --
Greets, Ken
Search for:
Text Formatted Code
// do resizeand insert in front of this line:
Text Formatted Code
// Keep Original Image with GDLib -- Hack begin --if ($this->_keepOriginalImage) {
$lFilename_large = substr_replace ($this->_getDestinationName(), '_original.', strrpos ($this->_getDestinationName (), '.'), 1);
$lFilename_large_complete = $this->_fileUploadDirectory
. '/' . $lFilename_large;
if (!copy ($filename, $lFilename_large_complete)) {
$this->_addError ("Couldn't copy $filename to $lFilename_large_complete. You'll need to remove both files.");
$this->printErrors ();
exit;
}
}
// Keep Original Image with GDLib -- Hack end --
Greets, Ken
8
8
Quote
All times are EST. The time is now 04:45 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content