#50373 [Bgs]: imagepng doesn't doesn't have lockflags
| From: | rugkiks at gmail dot com | Date: | Thu, 03 Dec 2009 23:55:40 +0000 |
| Subject: | #50373 [Bgs]: imagepng doesn't doesn't have lockflags | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145384@lists.php.net to get a copy of this message | ||
ID: 50373
User updated by: rugkiks at gmail dot com
Reported By: rugkiks at gmail dot com
Status: Bogus
Bug Type: GD related
Operating System: GNU/Linux
PHP Version: 5.3.1
New Comment:
It's the blocking feature i'm after. When the image is updating,
other fopen's needs to get blocked. It makes my code much more
simpler.
Also, you can do this with ImageMagick, since it allows you to
supply the file handle yourself http://php.net/imagick_writeimagefile
The only reason why i'm requesting this feature to GD, is because of
GD's speed.
rasmus: The renaming-method is nice. But in my case, i need the
users to be blocked until the image is ready. Not just show the old
one, or return a 404. I can program my way out of it, but it's
messy.
I guess i'm saying that it would be nice with a
http://php.net/imagick_writeimagefile for GD.
Thank you for the response.
Previous Comments:
------------------------------------------------------------------------
[2009-12-03 20:25:58] pajoye@php.net
Same here, I don't see how we could do that for every simple file
related functions. Please follow Rasmus' advice here, best possible
solution.
------------------------------------------------------------------------
[2009-12-03 16:39:32] rasmus@php.net
I'm curious why you want this. Locking is almost never the right
solution for a web app. Writing to a temp file and then atomically
rename it into its final destination. Adding locks to every library
function PHP can call that can potentially write files is not feasible.
------------------------------------------------------------------------
[2009-12-03 12:31:19] rugkiks at gmail dot com
Description:
------------
http://php.net/imagepng
Apparently there is not way to lock files while writing to them.
I'd like to see a similar behavior like the flags in
http://php.net/file_put_contents
Maybe the file actually get's locked. I can't test it.
Reproduce code:
---------------
---
From manual page: function.imagepng#Description
---
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50373&edit=1