Hello and thanks for taking on this project. I think it's something that is vital to manipulating images. However, I'm having some issues using your module.

When I select Title or Alt Title for text source I don't get any text added to my images.
Static Text works fine for me.

So I thought I would see what I could get with the PHP Code, and I can't seem to access any of the data from the global variable you write about in the read me file: $image_context.

If I use the default PHP code, return 'Hello World!';, that works for me.

I tried adding this code:

global $image_context;
return "source is ".$image_context->source;

but all it adds to the picture is the "source is"

Could you give me some additional direction on using this module? I'm sure others would also find it useful too.

Thanks for your help in advance and again for working on this important addition to image manipulation.

Steve

P.S. I hope I gave you enough information to help me.

Comments

fietserwin’s picture

With my site, alt and title, are working. Note:

  • You won't see any text with the sample image (i.e. on the admin/config/media/image-styles/edit/... screen) because that image has no image field referring to it.
  • The alt and/or title properties must be enabled and filled for the image field that is referring to a given image.
  • If there are multiple image fields referring to the image, the first found is taken.
  • In a multilingual situation things get even trickier, but still a result may be assumed to appear.

Considering the PHP code question:
The global $image_context is an array, not an object. Debugging this code will be hard. You probably should out all intermediate results in globals, so you can inspect them after the php_eval has executed (line 701 of image_effects_text.inc).

Concluding: if you can't get it to work with this information I need more information from you. Is it e.g. a multi-item image field? multi-lingual site? and more...

wickwood’s picture

Thanks for the prompt response and I will try to answer your questions to the best of my ability, but I don't quite understand some of the terminology yet.

I am aware of that I won't see any title or alt text for the sample image, but I guess from what you're saying that there will be know $image_context data at all.

This is not a multi-lingual site, and to my knowledge not multi-item image fields.

However, I guess that I may be using this module incorrectly because I'm not using it with an image field. I'm using the Media module (7.x-1.0-rc3) for uploading images and managing images with that and inserting them into a CKEditor WYSIWYG editor. I thought that the image data fields (like title, description etc.) would be available to your module, but that probably is not the case. Unfortunately, as of yet I don't know enough of how all these pieces are working together.

So I guess unless you have any suggestions for me on how I might go about integrating your module to work with Media, I'll just have to shelve this idea until I have more time to work on it.

Thanks again for your help and hard work on this very important and need feature.

Steve

fietserwin’s picture

Category: support » feature

OK, I see. I have no experience yet with the media module myself, so did not yet try to integrate it myself. There is a todo in the code about integrating with the Media module. So, I knew that, sooner or later, this issue would come by. I'll see what I can do.

wickwood’s picture

Category: feature » support

Thanks, and I wish I could be of more help, especially since this is something I really need. Time for me is really tight right now and my knowledge is limited, but if you need me to test anything or if I can assist in anyway, please let me know.

Steve

fietserwin’s picture

I'm sorry, but personal circumstances will prevent me of working on this the coming days/week.

wickwood’s picture

I totally understand, I'm in the same boat. Good luck to you in whatever you have going on!

fietserwin’s picture

Title: Title and Alt Title don't produce any text. • How to access the global variables? » Integrate with media module: Title and Alt Title don't produce any text.
Project: » ImageCache Actions
Version: » 7.x-1.x-dev
Category: support » feature

Moving to imagecache_actions as it is now part of that module and I'm going to delete the sandbox project.

fietserwin’s picture

Component: Code » Text Effects Module
Category: feature » bug

I guess that with (currently) some 85000 installs we should support the media module. So changing it into a bug report.

fietserwin’s picture

Status: Active » Fixed

Fixed and committed. Turned out not to be that difficult. Please test on your site and reopen if you find something.

Note that it is only tested on/works with media 7.x-2.x. Media 7.x-1,x has not been tested as I could not easily find references about alt and title being supported. The issue #1553094: Alt and Title support for Images indicates that alt and title support is only be available in 7.x-2.x. But as your feature request was posted before the mentioned issue was committed I might have overlooked something (submodule, standard workflow?).

If you need media 7.x-1.x support please provide the necessary information so I can add that easily as well. With necessary info I mean that I don't want to spend another couple of hours to support that version. So it should be quite complete in sense of where I have to look for it and how I can implement and test it.

dman’s picture

I'm starting to move towards media module (the big-boy distros are using it), so I'll be keeping an eye on its schema changes as I start to update meta module - which READS image EXIF & XMP to WRITE into media module fields. I finally have a contract I can put this work against. This is the exact inverse of what is being done here, and touches the same parts of the machine.

So, thanks fietserwin - I think this is a really helpful addition!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.