Closed (fixed)
Project:
ImageCache Actions
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Jun 2010 at 00:00 UTC
Updated:
28 Feb 2012 at 19:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
dman commentedIt's going to happen. he tinterface to imagecache (now partly in core) should be stable or consistent, so I don't see any reason why it will be too hard.
I'll have to put it off until I've got a planned project using 7 before I dedicate any unsponsored time to it though.
Comment #2
tsvenson commentedNice. I've actually already made one site, http://www.nutshell.nu, live on Drupal 7 alpha 5 this week and have not run into any big issues, same with the contributed modules I am using.
Unfortunately I don't have the resources (yet) to sponsor a port, but I will offer to help testing and evaluating it when you do find the time and/or sponsor for such a project.
Comment #3
ryan.armstrong commentedSame here, I would love to see this for Drupal 7, it's a great module!
Comment #4
Jackinloadup commentedsubscribe
Comment #5
rwohlebsubscribe
Comment #6
mike503 commentedYeah I was looking for "Define Canvas" which I was using in D6, but it's not available in D7 yet :(
Comment #7
nwe_44 commentedsubscribing
Comment #8
fultonchain commentedsubscribe
Comment #9
vood002 commentedSubscribing, happy to help test
Comment #10
justmagicmaria commented+1 on this request.
Comment #11
atobis commentedsubscribe
Comment #12
scott falconer commentedHere's a first shot at a d7 version. Core API changes, code style changes, etc.
Seem to be working as intended:
- canvasactions
- coloractions
Needs testing:
- autorotate
Still needs work:
- customactions (Should just need a few changes around the DB interface)
- testsuite
Comment #13
dman commentedExcellent. I was hoping to branch this over the weekend but missed that (Lovely Summer).
I'll try to make some time for that. Got some solid work on right now.
But this roll is much appreciated, I hope I can get it out there soon!
Comment #14
dman commentedOK.
I've put a new DRUPAL-7--1 branch up. Looks like you've been busy to get it that far, thanks!!
I'm dropping the 'tests' snippets idea altogether. I really wanted to get a solid test suite happening before I tried the upgrade, but I failed, so I'll remove those directories. Tests from now on I'll be bundling as exportable 'features'
Forget 'testsuite'
I had a small modification done to the D6 branch to support Features import/export, so I had to do a little of the patching by hand. About to start reviewing it now.
YES
- watermark works.
- watermark basic positioning works.
- watermark alpha works.
- watermark advanced positioning (right+100, bottom+100) works.
- define_canvas I got going after some work. color picker is still AWOL though.
- colorize works
- alpha transparency now works again, was aborting a bit on big images (alpha process on huge images is expensive), I've loosened the limitation. slow.
- brightness OK
- negative OK (removed a small warning)
- rounded corners (all) works
- rounded corners (individual) works
- textactions are gone - will be in a different module imageapi_textactions.
- aspect switcher - works, needed readjusting so that it's safe to export as features.
- Looks like some code there needs investigating, we are now inheriting a number of things that imageapi used to do for us - I need to see if I can find what those routines have been renamed to.
Great, thanks for your kick-start!
I'll try again to figure out what I can do for a real test suite.
HELP APPRECIATED if anyone wants to poke the effects - please find AND FIX any bits that are not working fully yet.
But it looks like most of the basics are now there.
http://drupal.org/node/999846
Take a fresh CVS, not that patch, many things are a bit adjusted.
Scott, do you want CVS? I would appreciate some help now I'm trying to track two branches. I like what you did, always appreciate a code clean-up!
Comment #15
dman commentedHere's a "feature" package of half-dozen test image styles I used.
If you enable features and install these, you should see them in action.
Comment #16
scott falconer commentedGlad I could help. CVS access would be great as I'm working on a project now that will make heavy use of imagecache_actions, so I'm sure I will have plenty to contribute back.
Comment #17
dman commentedYou have CVS!
Comment #18
will_in_wi commentedSubscribe
Comment #19
idiotprayer commentedTurned this on today, thanks for the work so far. A few things I ran into before I could get parts of it working. I have hacked around them for now, and I'm sure one of you who is more familiar will have better solutions than I. These seem to be rather large structural flaws that I can't wrap my head around now, considering the first problem I ran into immediately upon enabling.
Fatal errors on both imagecache_rgb_form() and hex_to_rgb() in utility-color.inc, redeclared function. I commented out both of these as I have no need of this functionality for now anyway.
The functionality I do need is in rounded_corners.inc. I had to change line 130, due to parameter expected to be a reference error.
Comment #20
scott falconer commentedThe patch attached brings utility.inc up to date with what's in the latest 6x branch (with a few changes) and everything seems to work as it should. I'm still wrapping my head around the code a bit, so let me know if this seems right and I'll get it committed.
Comment #21
dman commented@idiotprayer I apologize for some inconsistencies in the includes.
I had been attempting to break out the dependencies a little - what used to be one large set of util functions has been broken out into a few more specific libraries that the relevant submodules call when they want. Unfortunately sometimes I missed an include() that was needed, but didn't notice if another module was enabled that had already included the library.
Basically, the state of the inc libraries needs some rationalization. Architectural improvements welcome.
Comment #22
mstrelan commentedsubscribe
Comment #23
serg2 commentedsubcribing
Comment #24
traceelements commentedsubscribe
Comment #25
dman commentedI'm on holiday but intend to push a working release out when I get back to my desk. 3 weeks away from the laptop and in the sun instead is being enjoyed. But with d7 release a reality I'll see what I can do in the new year. Promise.
Comment #26
traceelements commentedThanks so much, dman! Have a good new year!
Comment #27
Branjawn commentedsubscribe
Comment #28
drupa11y commentedDefine Canvas and Underlaying (Background) still are creating errors:
Fatal error: Cannot redeclare imagecache_rgb_form() in /Applications/MAMP/htdocs/drupal-7.0/sites/mori.d7.dev/modules/media/imagecache_actions/utility-color.inc on line 15
Version was the latest dev-version available for download.
After applying the "imagecache_actions-818798.19.patch":
Fatal error: Call to undefined function imagecache_rgb_form() in /Applications/MAMP/htdocs/drupal-7.0/sites/mori.d7.dev/modules/media/imagecache_actions/canvasactions/canvasactions.inc on line 60
Rotate image e.g. works.
Comment #29
drupa11y commentedUnderlay background now works ;-)
Comment #30
fietserwinDefining a canvas with:
- "Resize canvas under image (possibly cropping)" checked
- exact size fields left empty
- relative size fields filled in
gives me:
Fatal error: Call to undefined function imagecache_actions_hex2rgba() in D:\Projecten\Drupal7\www\sites\all\modules\imagecache_actions\canvasactions\canvasactions.inc on line 215
Note: this function is called in canvasactions.inc and in coloractions/transparency.inc
Comment #31
fietserwin#30 was solved by applying the patch from #20 to the December 16, 2010 version at http://drupal.org/node/999846 (and installing imageapi that now is required))
However, now I get a:
Warning: Parameter 1 to image_gd_definecanvas() expected to be a reference, value given in image_toolkit_invoke() (regel 98 van D:\Projecten\Drupal7\www\includes\image.inc).
And after fixing that, the same on parameter 1 and 2 of image_gd_overlay in imageapi_image_overlay.inc
Fix by removing the & from the mentioned parameters, both in the gd and imagick versions of the mentioned functions. Objects don't need to be passed by reference if you want to change properties of the object (only if you want to assign another object to the variable)
Comment #32
fietserwinAnd another one:
file canvasactions/canvasactions.inc:
Seems to be an error to check on the width twice, the 2nd check probably should be on height
Comment #33
sludwig commentedsubscribe
Comment #34
fietserwinI tested "define canvas" using Imagemagick and found the following error:
(note: define canvas using imagemagick is not yet supported, but as there seemed to be an implementation, I thought to give it a try)
file: canvasactions.inc
function: image_imageapi_imagemagick_definecanvas
error: single quotes are added around the arguments, leading to error messages from convert
Configuration:
Windows Vista with
The error messages from convert on stderr:
Removing the single quotes works fine and as other actions don't add single quotes as well I think this is an error.
Comment #35
fietserwinAnd another one:
file coloractions/imagecache_coloractions.module:
function: function imagecache_convert_form:
Should be (i.e. remove 2nd isset on default value):
EDIT: Just found that this one is also reported for Drupal 6: #980408: Imagecache_convert action always reverts to ‘jpg’
Comment #36
fietserwinSee: #1022758: Convert format for imagemagick toolkit (with implementation) for implementation of convert format for imagemagick toolkit.
Comment #37
fietserwinI think that function imagecache_imagefilter (in file imagecache_coloractions.module) should make use of image_toolkit_invoke. This will lead to something like (not tested):
(I just see that the optional include of imagefilter.inc points to the wrong dir...)
Comment #38
dman commentedThe imagefilter function in general is not available outside GD. It's a messy func, and shouldn't be emulated for imagemagick.
What is supposed to happen is the individual actions ( imagecache_brightness_image etc ) should really be delegating to their own image_gd_brightness() sort of mini-funcs earlier on in the piece.
Re-using the GD 'imagefilter' function was just to avoid creating 8 trivial stub functions that did nothing except end up in the same place in the end anyway.
BUT if imagemagick versions for each of these actions is to be added, then yes, we should refactor the calls to use image_toolkit_invoke at the beginning of the process (imagecache_brightness_image) not half way through.
Comment #39
fietserwinIn addition to #34, when I tested the changes on a Linux server, it turned out that $backgroundcolor has to be escaped, but with the proper escape sequences for the actual platform. So use escapeshellarg(). The `resize canvas above image` option did not work at all, so I rewrote and tested that as well (on Linux and Windows) (see http://www.imagemagick.org/Usage/canvas/#solid for an explanation of the change).
file: canvasactions.inc
function: image_imageapi_imagemagick_definecanvas
new code:
Comment #40
fietserwin@#38: #37 was indeed an aside for me. I did not use it, so did not test it. I just stumbled upon it and thought let's mention it, hoping to arrive at a "correct" first official Drupal7 version.
Comment #41
kevin p davison commentedSubscribe, and please add a DEV or alpha version so more can test it out.
Comment #42
LEternity commentedI patched the Dec 16 version with #20 and got rid of the error described in #30. The rounded corner function isn't working. Please follow #41's request so more people will join in. Great module!
Comment #43
fietserwin@#41,#42: downloadable via "view all releases": http://drupal.org/node/263664/release, this is the 16 December release, so you will have to patch with #20.
My remarks so far are not available as one patch. I might produce one as soon as I have my site running stable. But hopefully dman can catch up with all remarks, as I guess that a patch against the december 16 version won't help him that much. If you want I can zip my local version as a whole.
Comment #44
kiyoshin commentedsubscribe
Comment #45
Countzero commentedThanks a lot for the patch in #20.
Applied to the 16th december version, it almost worked.
I only had to move the hex_to_rgb and imagecache_rgb_form to utility.inc from utility-color.inc to avoid the include/missing function loop described here http://drupal.org/node/1031588#comment-3984954.
Comment #46
Aleksey Zubko commentedCountzero, thanks a lot for your comment.
I apply patch in #20, after that move the hex_to_rgb and imagecache_rgb_form to utility.inc from utility-color.inc Then I have error such as in comment #31 and fixed them.
Watermarks work fine :)
Comment #47
fietserwinA patch containing all my remarks (between #31 and #39) and the patch from #20. So in fact this is one large patch against the 16 december dev version containing all(?) remarks in this thread so far.
Actually, I think this patch is growing too large. Is there some way we can get this patch (or at least the most important changes in it) into a new dev version and from then on separate all issues mentioned here into separate issues?
Comment #48
andypostsubscribe
Comment #49
fuse commentedShould rounded corners work after applying this patch? Still can't get it to work.
Comment #50
fietserwin@#49: I did not look into that.
There is a D7 version published on the project page now, so we should start to file and patch separate issues. However to not loose all the work in the patch, I hope dman, as practically the only committer for this project, will catch up.
On the other hand, with the imagapi imagemagick toolkit project being phased out (#1028876: Future of ImageMagick toolkit), I'm afraid that yet another big rewrite will be needed.
Comment #51
dman commentedYeah sorry guys, I have the hugest project on right now, and it's *not* D7, so it's a bit of a brain-strain to be working on two architectures at once.
I did look at the patch #47, but most of the bulk of it is whitespace changes - probably due to someones editor helpfully stripping trailing whitespace. So it's a big job to go through it line by line.
/however/
Seeing as to my mind the D7-dev is totally unreviewed (by me) so far, there is no great harm in trying to whack the whole patch at it without testing.
At least that will clear the decks and get us up to speed for the next round?
I'll commit everything here (unreviewed, untested) *iff* it applies cleanly. Let's see...
Comment #52
dman commentedOK. Yes, that was a clean patch - Nothing had been committed since before Christmas, as I guess everybody had noticed, so the Dec version was just fine.
I HAVE PUT #47 in to the current 7-dev.
I'm seeing issues already, but won't attack them just yet.
So, as fietserwin says, finish this thread, start new issues against D7-dev and we may be able to manage more progress.
Thanks for your patience fietserwin. I've been up to my ears in feature-driven deployments. Sorta needed all my attention on it. No flash graphics this month.
Comment #53
dman commented#1046200: Resolve the mystery of the hex2rgb functions
Comment #54
fietserwinThanks dman, I understand your situation. I had a smaller project and decided to give D7 a try to see if the modules I normally use were reliable and usable and to see if I could add some fixes, requests, etc. to D7 modules. I managed to get it all running but have posted quite some issues, though most of them were warnings due to the stricter error level of D7. For this module it was more lack of imagemagick support that wasn't there in D6 either. But the client wanted rotated thumbnails and those are *so* ugly with GD (no anti-aliasing), so I decided to try to fix those issues.
Any ideas on the future of this module (in D7, in the context of sun's activity on imagemagick)?
Comment #55
dman commentedI've never fully got behind imagemagick, it's just not something I use, apart from as a very simple commandline tool.
I've lost days trying to get the smallest things working, and it's seldom available on a number of medium-level hosts. So basically, I don't care much.
GD has issues, but at least I can understand them, and work around them using maths.
That said, I did manage to fix up D6-2.x imagemagick support to 98% around new year. overlays, borders, offsets etc all do their thing now. They just were not happening right before
If I get around to it, that can be ported to D7. I guess.
Comment #56
michaelfavia commentedSubscribe. Well done here guys. Next project i have needs watermark support so i was just checking in. Happy to help push the boulder a little further if this isn't resolved by the time i need it. Thanks for the hard work.
Comment #57
dman commentedimagecache_actions 7.x-0.0
Comment #59
witchcraft commentedSubscribe.
Comment #60
p.selfin commentedJust enable all submodules in ImageCache Actions
--
Sorry for my english
Comment #61
dman commentedYeah, sounds like one of the libs is depending on another that was'nt included. Sorry, my test suites are usually "turn everything on, test everything" . Have not tried every possible permutation. This one lib moved around a few times between versions, the required file prob got renamed.
Seems canvasactions needs to be sure to get the color form library. (I made things TOO modular)
Comment #62
boon4376 commentedI just wanted to give a big thanks to whoever is working on the Drupal 7 version. I am building an e-commerce site in D7 with Ubercart and the image cache actions have been invaluable for our product displays... Mostly the "define canvas" option for generating thumbnails.
Thanks Again!!!