You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Robert <ro...@robert.cz> on 2001/11/26 13:17:16 UTC

Two Apache::ImageMagick comments

Hi,

  I wanted to say that Apache::ImageMagick is really cool (look at
http://www.jalta.cz/ - all the previews and all the grafical page titles
are generated automatically with AIM). 

  Here're two problems I found:

- when script changes, AIM should invalidate all cache entries created
by that script - one could change color, font etc and AIM should
recreate all corresponding images. Maybe script modification time can be
added to the hash key?

- AIM keeps file locked (open'ed?) even after the thumbnail was created
and send to the client. It creates problems eg when one needs to remove
stuff from cache, apache has to be restarted before etc

- Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Two Apache::ImageMagick comments

Posted by Gerald Richter <ri...@ecos.de>.
>
> OK. May I propose the "NoCache" mode that would be quite usefull for
> developing/testing? Something like
>
> SetEnv AIMUseCache No
>

It's already there, just write

PerlSetVar AIMCache off


>
> PS Up till now my most common mistake is to forget to set up the
> corresponding write permissions to the cache directory. Maybe AIM should
> give better warning like die with 'Unable to write to cache' or
> something more clear in such cases to give more user-friendly
> diagnostics.
>

You should get an error message in you httpd error log, which says "cannot
write cachefile: permission denied".  Much more can't be done.

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Two Apache::ImageMagick comments

Posted by Robert <ro...@robert.cz>.
Gerald Richter wrote:
> 
> > - when script changes, AIM should invalidate all cache entries created
> > by that script - one could change color, font etc and AIM should
> > recreate all corresponding images. Maybe script modification time can be
> > added to the hash key?
> >
> 
> Also this is possible, it would involve to much overhead, so normaly picture
> serving would slow down.
> 
> The easiest solution is to delete all pictures from the cache when you
> change your script. They will be recreated with new script parameter on the
> next request.

OK. May I propose the "NoCache" mode that would be quite usefull for
developing/testing? Something like

	SetEnv	AIMUseCache	No

that would make AIM immediately create a new picture no matter what's
already in the cache? Again, this is of very limited use in the
production server (well, maybe you want to generate images of the map
and "You're here" sign - you don't really want to cache them a lot) but
could still be extremaly usefull for testing and developing when one has
to play with the parameters to find optimal combination etc. (like
'quality' parameter for size vs. quality of JPEG previews)

- Robert


PS Up till now my most common mistake is to forget to set up the
corresponding write permissions to the cache directory. Maybe AIM should
give better warning like die with 'Unable to write to cache' or
something more clear in such cases to give more user-friendly
diagnostics.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Two Apache::ImageMagick comments

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
>   I wanted to say that Apache::ImageMagick is really cool

:-)

>
>   Here're two problems I found:
>
> - when script changes, AIM should invalidate all cache entries created
> by that script - one could change color, font etc and AIM should
> recreate all corresponding images. Maybe script modification time can be
> added to the hash key?
>

Also this is possible, it would involve to much overhead, so normaly picture
serving would slow down.

The easiest solution is to delete all pictures from the cache when you
change your script. They will be recreated with new script parameter on the
next request.

> - AIM keeps file locked (open'ed?) even after the thumbnail was created
> and send to the client. It creates problems eg when one needs to remove
> stuff from cache, apache has to be restarted before etc
>

Oops, this is a bug. Fixed in Apache::ImageMagick 2.0b5

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org