ImageMagick GraphicsClass

vallimar

Joined: 2002-08-15
Posts: 487
Posted: Fri, 2002-08-23 07:00

Hey, bharat, I took a stab at making an ImageMagick graphics class
based on your NetPBM one. I have no idea if it works but it's some
groundwork. I don't fully understand how you have things going
and it didn't even look like the NetPBM one would work properly,
but what do I know, aye? Anyhow, if you'd like to try it out
<!-- BBCode Start --><A HREF="http://sexorcisto.net/gallery-patch/IM-Class.zip" TARGET="_blank">here is a link to the zipfile</A><!-- BBCode End -->. If nothing else, it's
at least some groundwork in the hopefully right direction.

Oh, and I'm not sure what all you'd need to do to hook it up in the config.
One thing I did notice is that you no longer have an option for 'quality' or
'compression' (png) settings. Oddness. Oh, was wondering if you cared
to think about including support for mass image conversion.. IE, converting
everything but say animated gif's to png format for example. Either after upload
or during upload. Or possibly just an option to convert all thumbnail/resized images
to the same format rather then inherit the parent format. Or both perhaps.

Not sure how easy it is to determine an animated gif with netpbm, but with IM's
identify you will get multiple lines giving you stats on each frame. Instead of a
single line as usual.

Hmm, I'm rambling a bit and forgot the other thing I wanted to mention,
perhaps I'll remember it later.

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Mon, 2002-08-26 01:15

Okay, since the newest CVS release of G2 seems to work better for me,
I went ahead and tested my ImageMagick class. Found some errors and
subsequently fixed them. The only thing I'm not sure will work is the chop
function. I think it will, but I'm not positive, this will need to be tested later
when there are facilities to test it :wink:

The zipfile contains a patch which is all you should need, also includes
the classfile standalone for perusal. To test, just change 'netpbm' in
config.php to 'imagemagick' after applying the patch and it should work.

<!-- BBCode Start --><A HREF="http://www.sexorcisto.net/gallery-patch/g2-imagemagick.patch" TARGET="_blank">The Patch itself</A><!-- BBCode End -->.
<!-- BBCode Start --><A HREF="http://www.sexorcisto.net/gallery-patch/G2-ImageMagick.zip" TARGET="_blank">The zipfile.</A><!-- BBCode End -->.

 
Eddy

Joined: 2002-08-23
Posts: 9
Posted: Mon, 2002-08-26 21:24

vallimar:

I haven't tried out your ImageMagick mods yet, but I have a question based on some previous work I did with IM...

Is there an easy way to delete the extra "junk" in a JPEG image so it doesn't cause a thumbnail to be excessively large? In the past I've converted from JPEG->RGB->JPEG to get rid of the extra color profiles/EXIF tags/etc., but there has to be a better way...

Keep up the great work!

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Wed, 2002-08-28 23:02

It would simpler for you to use: +profile "*"
That strips all extra information from the images.

I haven't updated the G2 patch for it, and cropping is broken in the G2 patch
but I was just playing to see if I could get a base going.

If you goto http://sexorcisto.net/gallery-patch/ you will see my current
util.php file which includes the profile stripping and a couple other things.

I've informed T. Nan (the original IM modder whose work is in the contrib section),
and I think he is going to update his site to reflect my changes to his base work.

When G2 is in a more useable state, I'll update the G2 patch further.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2002-08-29 06:06

Excellent work, vallimar. I've got a link to the patch and will get that code checked in first chance I get. As you noticed already, the GalleryGraphics class is not yet fully thought through. I'll be spending more time in design on it shortly. But I'll get your code into the repository so that we can see what it looks like when we have multiple toolkits.

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Thu, 2002-08-29 20:38

Sounds good, I stopped subscribing to the cvs-checkins list as I was getting
spammed by all the gallery-remote check-ins :razz: I still check the archive
occasionally though and I'm on the devel list still though, so hopefully I'll
catch when you make updates to the graphics class and I can update the
IM version as well.

Oh, wanted to mention, I thought it would be a good idea to have the
function getJpegImageQuality() masked in the Graphics sub-classes to
return a string appropriate for that command-class that can be inserted
into the command array.