Anyway - I'm experimenting with imagecache actions. I've followed the documentation and placed an image using the Actions: scale and crop, define canvas, and underlay. The sample Drupal photo in the preview looks right, but in the Views preview and the actual output show black around the right and left side.

Anyone know what's going on here, what i'm doing wrong?

Here are my settings:

scale and crop 162x162

define canvas 172x172 (0,0) transparent under image

underlay 0,0 100%

Comments

Benj’s picture

Using the alpha channel I got rid of the black. The the dropshodow image get degraded.

szy’s picture

Using the alpha channel... where?

I have the same problem, with:

Javascript crop:
width: 100%, height: 100%, xoffset: center, yoffset: center, resizable: 1, don't crop if region is not set: 0

Scale And Crop:
width: 443, height: 280

Underlay: place a file image under the current image (background):
xpos:6, ypos:7 alpha:100%

Overlay: file image to canvas (watermark):
logo.png x:right, y:bottom alpha:33%

There is an underlay below the photo and a watermark above it.

Szy.

dan.crouthamel’s picture

I noticed that if I use the latest version (1.4) of ImageAPI , that I run into problems with using the underlay. Using ImageAPI 1.3 and ImageCache_Actions 1.2 works better.

dman’s picture

Here's what the most recent (as in a few days old dev version of imageapi, imagecache and imagecache_actions)
should produce:
http://drupal.org/node/373590#comment-1338190

Hm. Didn't look at "define canvas"

szy’s picture

I still have this image:

-> http://img410.imageshack.us/img410/7703/imgctnswrong.jpg

... instead of:

-> http://img403.imageshack.us/img403/7926/imgctnsright.jpg

My preset consists of:

Javascript crop:
width: 100%, height: 100%, xoffset: center, yoffset: center, resizable: 1, don't crop if region is not set: 0

Scale And Crop:
width: 443, height: 280

Overlay:
file image to canvas (watermark) logo.png x:right, y:bottom alpha:33%

Underlay:
place a file image under the current image (background)

Do I still need to work with ImageAPI 6.x-1.3 and Imagecache Actions 6.x-1.2?
There is still no fix, or am I missing something?

Szy.

szy’s picture

Version: 6.x-1.2 » 6.x-1.4
szy’s picture

Version: 6.x-1.4 » 6.x-1.5
szy’s picture

(... and my system is GD powered).

Szy.

dan.crouthamel’s picture

I had a similar problem when moving to the latest versions of imageApi and ImageCacheActions. What I did to fix my problem was to first convert the image to png format. After that, things seem to work as they previously had.

Actually, I had to do that for the 1.4 version of imagecache_actions. I see 1.5 is now available. Should be interesting to see what happens when I upgrade to it :)

dman’s picture

1.5 is just a fix for the textactions that had the same problem as the other actions when imageapi changed the API. No change there to transparency issues.

szy’s picture

@dman, thanks.

@dan, strange - converting to png didn't help me :/

Szy.

szy’s picture

I've changed my approach: now I don't use an underlay (with a shadow), but
now I add an overlay on the photo, with transparent shape inside, so it looks
identically:

-> http://img253.imageshack.us/img253/8995/imgctnsright2.jpg

Preset content:

Javascript crop
width: 100%, height: 100%, xoffset: center, yoffset: center, resizable: 1, don't crop if region is not set: 0

Scale And Crop
width: 460, height: 309

Overlay: file image to canvas (watermark)
shadow.png x:, y: alpha:100%

Overlay: file image to canvas (watermark)
logo.png x:right, y:bottom alpha:33%

Szy.

PS. How can I embed a photo inside my post here? As dman did above?

dman’s picture

Overlay is certainly a way around it. But it should (and does for me) allow transparencies on underlay. There is however currently a little issue with which image size takes priority when placing an underlay. I've tried to add options to make sense, but haven't really thought through the logic and requirements.

I'll keep at it. Slowly.

The image permissions come with being a drupal.org documentation maintainer :-B . It's not really meant for illustrating issues, but I can, so I do.

szy’s picture

@dman, thanks, for all your work with the module too, it's really a big thing.

Szy.

adraskoy’s picture

Having the same issue, trying to add a dropshadow with a transparent background. Partially solved it with a canvas resize and an overlay (instead of an underlay). But... weirdly the resulting background was either black (where there had been any shade of grey in the dropshadow image) or white (where it had been completely transparent). It did look fine in the preview, however. I changed the alpha to 99% in the overlay config and now I get a proper dropshadow, but the background is white not transparent.

adraskoy’s picture

Solved this, at least partly. The uploaded images I was using were jpgs. When the transformations added transparency, I was expecting to end up with a final format that supported transparency, i.e. png. Probably this is expecting too much, but it would be nice to either have this behaviour automatically or to be able to specify it. As a workaround, uploading a png instead of a jpg solved the problem.

dman’s picture

it would be nice to either have this behaviour automatically or to be able to specify it

This is documented several times elsewhere - You have many choices - either use the file format switcher (to convert to PNG), use the define-canvas action or the alpha-flatten action (to fill in the back with a solid color), or even merge over top of a background with the 'underlay' action.
Note that convert to PNG is pretty painful on the filesize - this is something in the GD toolkit.

dman’s picture

Status: Active » Closed (fixed)

I think this old issue reached a conclusion. Closing