Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online Now
0 registered members (), 45 guests, and 232 spiders.
Key: Admin, Global Mod, Mod
Member Spotlight
Gizmo
Gizmo
Portland, OR; USA
Posts: 16,930
Joined: June 2006
Show All Member Profiles 
Top Posters(30 Days)
isaac 18
Gizmo 12
Ruben 11
Morgan 3
Abbott 2
Latest Photos
Testing to drag photos
Comfortable Cats
Test
BSA photos
Chinese Buddhist temple.
Previous Thread
Next Thread
Print Thread
ImageMagick vs GD2 #260863
01/11/18 09:11 AM
01/11/18 09:11 AM
Joined: Jun 2006
Posts: 588
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 588
Sweden
7.6.1 installed
I know you developers prefer ImageMagick over GD2 please read below test.
ImageMagick does not seem to work as GD2" when it comes to reduce pixel size.
What can be wrong??? as it is now I will use GD2 but I want off course to use ImageMagick so what can I do to change the way ImageMagick works???
Is this something I can change or maybe the forum software or my host I use a VPS service from Interserver.
Please advice

The original photo was 7,3MB .jpg all uploads are the same photo

Gallery forum test: one using GD2 and one using ImageMagick.
Test is done to compare the full size image.
As you can see GD2 reduces the full size image pixels down to 800x500px while ImageMagick keeps the original 3780x2389 pixels size.
I have used a 90% high resolutions just to get a good image with GD2. Thumbs and Medium are default sizes.

test upload with 90% full size GD2
http://www.britbike.com/forums/ubbthreads.php/galleries/721728
http://www.britbike.com/forums/gallery/32/full/3015.jpg 169kb

test upload with 90% full size ImageMagick
http://www.britbike.com/forums/ubbthreads.php/galleries/721729
http://www.britbike.com/forums/gallery/32/full/3016.jpg the full size image that has NOT been reduced in pixel size 2,89MB


-----------------------------------------------------------------


Below are same test but for forum posts I used only 10% resolution to see how the image quality.
GD2 reduced the size down to 800x505px just like the Gallery did
and ImageMagick did not reduce the pixel size.

test upload with 10% full size GD2
http://www.britbike.com/forums/ubbt...-upload-with-10-full-size-gd2#Post721721


test upload with 10% full size ImageMagick
http://www.britbike.com/forums/ubbt...with-10-full-size-imagemagick#Post721720





Last edited by Morgan; 01/11/18 09:18 AM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
Re: ImageMagick vs GD2 [Re: Morgan] #260865
01/11/18 12:55 PM
01/11/18 12:55 PM
Joined: Apr 2004
Posts: 1,171
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,171
California
I believe you may have misunderstood how image compression works. Setting an item to use 10% compression doesn't mean that the output file will be garenteed to be reduced by 10% of it's original file size. There are a lot of additional factors involved in 2hat happens to an image and that's based on what the image contains. Each image is unique. And your JPEG image is probably already somewhat compresses before you even touch it.

https://en.m.wikipedia.org/wiki/JPEG

UBB.threads has no control over the version settings of ImageMagick or gd configured on your server. it just takes the image and passes it along to the with the compression/sizing requests, and goes from there.

There is not really much more that can be done to these blanket strings passed from a single command line to every single image that goes through it.

ImageMagick is generally better and handles transparent png/gif files and animated gif files better. GD is a bit quicker and requires slightly less memory and is bundled with current php server package installs.

Beyond that, I'm not really sure what youd like ubb.threads to do, based on your post.


isaac @ id242.com // forum @ CelicaHobby.com
a current developer of UBB.threads php forum software // 7.6.2 Changelog
Re: ImageMagick vs GD2 [Re: Morgan] #260866
01/11/18 01:30 PM
01/11/18 01:30 PM
Joined: Feb 2007
Posts: 1,332
Pennsylvania
JAISP Offline
veteran
JAISP  Offline
veteran
Joined: Feb 2007
Posts: 1,332
Pennsylvania
I think he was saying don't run out and have ImageShack installed if you don't have it on your server.

Re: ImageMagick vs GD2 [Re: JAISP] #260867
01/11/18 01:39 PM
01/11/18 01:39 PM
Joined: Apr 2004
Posts: 1,171
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,171
California
Originally Posted by JAISP
I think he was saying don't run out and have ImageShack installed if you don't have it on your server.


JAISP, this is nothing to do with ImageShack https://imageshack.com/

If you want to handle Animated GIF or images with transparencies, ImageMagick is preferred. As I have found GD to have troubles with those on each of the three test servers available to me.

As always, its best to do your own research and use what works best for your own personal needs. And thankfully, there are a lot of back & forth discussions of ImageMagick vs GD all over the internet at this time. http://bfy.tw/FzoQ


isaac @ id242.com // forum @ CelicaHobby.com
a current developer of UBB.threads php forum software // 7.6.2 Changelog
Re: ImageMagick vs GD2 [Re: Morgan] #260868
01/11/18 01:49 PM
01/11/18 01:49 PM
Joined: Jun 2006
Posts: 588
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 588
Sweden
(Oh I was writing my reply when you were posting so I didn't see above replies)



Hi Isaac, The 10% example was just an example so we can forget the percentage.

The difference between ImageMagick vs GD2 how it works on my UBBThreads vs yours or others UBBThreads is interesting

On BritBike forum the GD2 setting executes a compression/sizing and because it reduces px sizing the end product becomes sufficiently small in size. That I like.
I tested to set both max 800px and 1920px so that works at least for jpg's.
Imagemagick executes a string for compression but not pixel sizing. That I don't like.

Since ImageMagick overall handles images better I wonder is there a way to get both compression/ px sizing by using ImageMagick?
Maybe I need to ask the correct question to my host.. whatever the queston is.
It might be of interest to other UBBThread forum owners.

The GD2 string UBBThreads is producing certainly works but not the imageMagick string.

Anyway I thank you for listening to this forum enthusiast without the proper techical education.
I'll keep the GD2 setting for now and test a bit more. If I get certain enough I will change the settings for our
members so that they can upload at least 8MB images to BritBike instead of having toresize first themselves.
The members would just love it.

Btw thanks for 7.6.1 I have only received positivities from our members smile


Last edited by Morgan; 01/11/18 02:01 PM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: ImageMagick vs GD2 [Re: Morgan] #260869
01/11/18 02:11 PM
01/11/18 02:11 PM
Joined: Apr 2004
Posts: 1,171
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,171
California
Originally Posted by Morgan
The GD2 string UBBThreads is producing certainly works but not the imageMagick string.


You're welcome to open the php script yourself and skim through it. The scrip is simple, quite small, and easy to quickly get through. Its located at:
/libs/image.inc.php

In that script, the same basic string format is used for each:
$exec = "\"{$config['CONVERT_PATH']}\" {$config['FULL_PATH']}/tmp/$sourcefile $thumb {$width}x{$height} $quality {$output}:\"{$config['FULL_PATH']}/tmp/$sourcefile.$type\" 2>&1";

Remember though, the setting which UBB.threads use are the most basic, with the pure intent of covering the broadest type of images sizes and their content. A photo of the grand canyon vs a photo of a starry night vs an animated gif vs a family gathering vs a screenshot or a transparent company logo... of which may all produce different results.

Regarding UBB.threads, if your intent of using the image attachments feature is to share visual images with others on the internet, it just works as intended. But if you need the attachments to be guaranteed untouched, or you have a batch/package of many images, your best bet is to put them all in to an archive (such as zip or rar) and attach that file.

Further reading:
https://www.sitepoint.com/imagick-vs-gd/
(nothing specific other than it being the very first link in google when searching for im vs gd)

And of course:
PHP & GD @ https://secure.php.net/manual/en/book.image.php
PHP & ImageMagick @ https://secure.php.net/manual/en/book.imagick.php


isaac @ id242.com // forum @ CelicaHobby.com
a current developer of UBB.threads php forum software // 7.6.2 Changelog
Re: ImageMagick vs GD2 [Re: Morgan] #260870
01/11/18 02:20 PM
01/11/18 02:20 PM
Joined: Jun 2006
Posts: 588
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 588
Sweden
Thank for the info
the photosmembers are uploading is for sharing with other members.
Very often it is various photos of bikes and parts and restorations
or a bike meet or a holiday photo so its nothing complicated as I see it.
They can of course link from other sites also but that is something different.

If they need to send high res then they can always ask to be emailed.
I'm checking what I can find in my VHM / CP right now.
I will check out your info above asap to see what i can learn.

Cheers


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: ImageMagick vs GD2 [Re: Morgan] #260871
01/11/18 02:35 PM
01/11/18 02:35 PM
Joined: Jun 2006
Posts: 588
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 588
Sweden
Isaac.

here I am the novice, amateur whatever.. someone said there are no dumb questions so I take a chance.
I opened the /libs/image.inc.php and fount this code.
question what happen if I change the value "99999" to "800" ?
would it force the full size image to max 800px ?
If so maybe in a future it could be in the CP that one could set your own value there?
Just asking grin


Quote
function resize_image($type,$sourcefile="") {
global $config;

if (!$config['MAX_THUMB_W_H']) {
$config['MAX_THUMB_W_H'] = "200";
}
if (!$config['MAX_MEDIUM_W_H']) {
$config['MAX_MEDIUM_W_H'] = "480";
}
if (!$config['MAX_FULL_W_H']) {
$config['MAX_FULL_W_H'] = "99999";
}


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: ImageMagick vs GD2 [Re: Morgan] #260872
01/11/18 02:51 PM
01/11/18 02:51 PM
Joined: Apr 2004
Posts: 1,171
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,171
California
Those are default values for when there is nothing stored in the configuration file at all.

ie; !$config

After you visit/submit the configuration page in the Control Panel for the very first time, values get set, and those lines of code you quoted are never used.

Its intended as a safety net for when a forum is upgraded from an older version, and the admin neglects configuring their forum attachment settings.

edit:
its similar to using "Your Forum Name" as the default forum name used, when an admin has not set one yet.

Last edited by isaac; 01/11/18 02:54 PM.

isaac @ id242.com // forum @ CelicaHobby.com
a current developer of UBB.threads php forum software // 7.6.2 Changelog
Re: ImageMagick vs GD2 [Re: Morgan] #260873
01/11/18 03:15 PM
01/11/18 03:15 PM
Joined: Jun 2006
Posts: 588
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 588
Sweden
OK Isaac, that does not work then. it was worth a shot..

A new question came up in my head.
The Thumbs and Medium options are actually being resized when I alter the settings and upload a new image, I have lowered both those settings but not increased above default. What is the difference between Full size vs Thumb/Med and why is the Full not being reduced in pixels? That is my question and I understand if you can't answer but it's in my head for now and I can't see that it should be different.

Enough thinking for today smile

Last edited by Morgan; 01/11/18 03:16 PM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?
Re: ImageMagick vs GD2 [Re: Morgan] #260875
01/11/18 03:35 PM
01/11/18 03:35 PM
Joined: Apr 2004
Posts: 1,171
California
isaac Offline
UBB.threads Developer
isaac  Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,171
California
iirc, small, med, large are for processing gallery thumbs/full of the images. post attachments get just the large (regular) attention.


isaac @ id242.com // forum @ CelicaHobby.com
a current developer of UBB.threads php forum software // 7.6.2 Changelog
Re: ImageMagick vs GD2 [Re: Morgan] #260876
01/11/18 03:48 PM
01/11/18 03:48 PM
Joined: Jun 2006
Posts: 588
Sweden
Morgan Offline OP
addict
Morgan  Offline OP
addict
Joined: Jun 2006
Posts: 588
Sweden
So while processing a
small=thumb 200px default
medium=medium 480px defaul
large=full 1920px default... this option in the future could be a menu saying 640, 800,1920, etc etc and end maybe with original size. and it would be handled same as thumb and med.

wishful thinking anyway.. smile

I have taken to much of your time now.
Time for lunch where you are and evening beverage where I am
Thanks


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php?

Shout Box
Today's Birthdays
No Birthdays
Recent Topics
Custom Insert won't save
by Baldeagle. 06/18/18 07:44 PM
New Image capabilities ver 7.6.1
by Abbott. 06/14/18 02:28 PM
Thread deleted?
by Lisanne. 06/05/18 11:13 AM
random 500 server errors on post
by Bad Frog. 05/31/18 09:34 AM
Upgraded from 7.6.0 to 7.6.1.1
by BB. 05/30/18 12:33 PM
Forum Statistics
Forums36
Topics35,121
Posts191,324
Members12,085
Most Online978
Jun 24th, 2007
Random Image
Powered by UBB.threads™ PHP Forum Software 7.6.2
(Preview build 20180524)