![]() |
How does the Image Class Work?
So I want to take an image... which is 4:3... resize it, and then crop it to 16:9. I know how to do this using GD2, but sadly it doesnt work with ImageMagick. So now I'm trying to use the existing image classes in VB to handle it... but I can't get them working either...
Code:
require_once(DIR . '/includes/class_image.php'); --------------- Added [DATE]1273196508[/DATE] at [TIME]1273196508[/TIME] --------------- This is what I am using now... Code:
if ($vbulletin->options['imagetype'] == 'GD') The second set is commented out, because I can't get it working... Either I need to figure out how to do this with the built in image classes... or I need to figure out how to do this with the imagick class... I can't figure out either. |
So anyone got any ideas?
|
So absolutely no one knows how the image class works?
All I want to do is take an image, crop from center and resize. |
So yeah... bumping once again... Need to either get the image class working, or figure out how to resize an image using ImageMagick...
|
Bump..........
|
What do you mean it's not working? Are you getting errors?
|
Which part are you talking about? The ImageMagick code doesn't work as it just sends me to a blank white page (stops processing code) and doesn't write any image to the $target file. The Image Class code doesn't work because its obviously incomplete and there isn't even a write step anywhere in the code. So I need to either find out why the ImageMagick code doesn't work, or complete the image class code. But the VB4 image class is obfuscated to all hell, so who knows what the hell is going on in those files.
|
What is the returned value of $image->fetch_thumbnail() ?
Also, I'm not very familiar with vB's image class, but from the looks of it, it doesn't handle actually uploading the file. This is a good thing. You'll probably have to use vB's file class to upload it to your server. |
Which is the purpose of this thread...
I have no idea how to write a thumbnail using the VB image class. According to vB_Image_Abstract fetch_thumbnail creates the actual thumbnail, but I don't know what to do next. The VB upload class is even more confusing than the VB image class; and neither are well documented. Let me explain my function... It takes in 2 variables, the first one is a URL to an image; the second is the ID where it will be stored. Code:
function build_thumbnail($thumbnail, $mediaID) first it gets the image information using VB's built in cURL then it uses fwrite to write the $result to $target then it gets the location and filename of the file it just wrote to edit it then it defines crop variables, width, height and quality Then it should generate a thumbnail using VB's image class... However, print_r($thumb) outputs the following: Code:
Array ( [filedata] => [filesize] => 0 [dateline] => 0 [imageerror] => ) --------------- Added [DATE]1279646313[/DATE] at [TIME]1279646313[/TIME] --------------- However, I don't think it even matters, since the VB image class doesn't crop anything, which is essential for this. I should just use the two methods for GD and Imagick; but I can't get the Imagick function working. Code:
function build_thumbnail($thumbnail, $mediaID) |
You have Image Magick installed on your server? (Let's get the easy questions out of the way first hehe)
|
Haha... yes of course, the server I am trying to install it on does not have GD, it only has Image Magick.
|
All times are GMT. The time now is 05:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|