[LONG POST] GD wont display the image [COMMENTED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

its working now :D

anyway, i made a few modifications and additions to the class and i noticed that.... whilst imagecopyresampled is recommended over imagecopyresized, it is noticably slower and from what ive seen so far offers no real increase in quality (this is tested, not theory)

i currently have it setup so that if the user has GD2, imagecreatetruecolor + resampled are used and if only GD1 is available i offer imagecreate + imagecopyresized (these 2 are only available in GD2), now because this project is aimed at the end user, should i give an option in config which overwrites this (this option would only be available to GD2 users, something like

Use Low Quality | Faster
Use High Quality | Slower

i just feel that it would be an 'ingenious' idea to move away from the standard config options, that are not exactly beginner friendly eg

Code: Select all

define ("GD_USAGE", "use_this_one");
and give a more natural way of doing it... if you have no idea what im baffling on about then sorry :wink:

Give me your thoughts, it would be much appreciated
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

bump for question above
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

Just pure thought, as it is a class, it should be getting parameters via the constructor or method for changing options. When you create a class, half of the idea is to be able to have full control over something, or many of it... having it in a config-file requires you to have that file, and also ruins a little of the class-thinking.

I would probably add a "setOption" which takes an id and a value.
or perhaps, "setHighQuality" or something like that, depends on what you are going to do and in what scale.
Post Reply