-monochrome?

jfriesen - June 13, 2006 - 20:57
Project:Image Exact Sizes
Version:4.7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi there!

I really appreciate this module; it's exactly what I was looking for! I'm a complete Drupal neophyte, but I am very comfortable in Standards-based (X)HTML and CSS and quite comfortable in PHP.

I'm using this module in conjunction with image and img_assist. What I want to do is have those lovely thumbnails generate in black-and-white.

I tried adding the following PHP to the image module's "image.imagemagick.inc":

<?php
/**
* Convert an image to black and white
*/
function image_imagemagick_monochrome($source, $dest) {
 
$filter = ' -monochrome ' ;
  return
_image_imagemagick_convert($source, $dest, $filter); 
}
?>

The idea is to be able to add that flag to the overall command, as per the ImageMagick documentation. What I'm not sure of is how to make this happen from image_exact.module...

Thoughts?

Contact me for help

#1

jfriesen - June 14, 2006 - 16:44

It seems that if using the GD module, the command is -greyscale, not -monochrome. The question remains, though: how to call it through Image Exact Sizes when applying to the thumbnail? I'll post some example code from IES later, unless someone can help me earlier.

#2

jfriesen - June 18, 2006 - 15:08

I'm finding it quite disturbing that there's no community support on this issue. If someone is familiar with this issue and can lend a hand, I'd be most grateful...

#3

aaron - June 26, 2006 - 18:55
Category:support request» feature request

not sure off hand. without trying, i suspect that in function image_exact_resize, you'll want to call your function just before image_resize($destination, $destination, $final_w, $final_h);

this sounds like it would be a nice (optional) feature. not sure if this would be the right module for it, or if it should be in another module.

#4

joshk - June 26, 2006 - 19:30

I'd be open to expanding this module to be a sort of "image processing" dohicky that does a bunch of things to images after they're uploaded. I think setting up some color-shifting options (or even adding a text slug) wouldn't be out of the question.

Either that or we should roll this and the existing re-size functionalty into a new module. That seems better than having a whole slew of image-altering things to confuse people.

#5

jfriesen - July 11, 2006 - 01:42

In the meantime, does anyone have a suggestion for sending the appropriate flag to the image processor?

 
 

Drupal is a registered trademark of Dries Buytaert.