Re: php version of GD lib
| From: | Jochem Maas | Date: | Fri, 04 Nov 2005 17:25:42 +0000 |
| Subject: | Re: php version of GD lib | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225095@lists.php.net to get a copy of this message | ||
Erron Walker wrote:
Thanks for the response, I will look into that. I'm a little unsure whatgiven that you don't pay me large ammounts of money to support your php problems I'd apprieciate it if we kept the discussion 'onlist' - that way other benefit from any solutions/ideas that might come about AND other people can see your questions and give a response (chances are cleverer, more experienced people then me!)
you meant by using flock() on a separate file though. I have an image file that is required by different requests made to apache at the same time...what kind of separate file would I use?any file. just a file. say you need to regenerate /var/images/abc.jpg then when your processes attempt that they must first successfully flock another e.g. /var/images/gen-locks/abc.jpg where /var/images/gen-locks/abc.jpg is just an empty file, your process needs to create it and flock it successfully before going ahead and generating. actually using directories instead of files as lock markers is better because creation of directories is atomic - if you need more info: a/ pray someone reads this that knows more than I do. b/ try google on 'file directory locks' (or something) hth, unfortunately I can't help much further - I have reached the boundaries of my practical knowledge ;-)
Thank you for your help in advance. Erron ----- Original Message ----- From: "Jochem Maas" <jochem@iamjochem.com> To: "Erron Walker" <erron@endevouraerospace.com> Sent: Friday, November 04, 2005 7:36 AM Subject: Re: [PHP-DEV] php version of GD libErron Walker wrote:I am using the version of GD packaged with php 4.3.x for windows and am having a problem with opening images and not being able to lock them. As soon as I have multiple users requiring the same dynamically generated image, the image sent to the browser is all distorted and blurred but only happens when multiple users are accessing the exact same dynamically generated image. I would like to lock the images before processing but the functions for gd (eg. imagecreatefromgif() require a filename string and not a resource handle created by flock().this is a question for the generals mailing I think - if you can't use generated unique names (e.g. uniqid()) then try flock()ing a seperate file... and checking against that (in rather the same way that, for instance, cvs uses 'lock' dirs to keep things atomic.)Any insight would be appreciated.