Hello,

I turned on the cache in Brilliant Gallery, and I found this error in Druplas log:
filectime() [function.filectime]: stat failed for /home/www/vhosts/domain.tld/public_html/tmp/bg_c82ea93c370302f9f85e86e808c01025 in /home/www/vhosts/domain.tld/public_html/sites/all/modules/brilliant_gallery/image.php on line 60.

I use Gentoo linux, PHP 5.2.5, lighttpd 1.4.18
Do you need more info?

Comments

Nitagob’s picture

I have changed the following function in /sites/all/modules/brilliant_gallery/image.php:

function resizeimage_wrapper_filecache() {
...
some code/comments here
...

#$cachedfile = file_directory_temp() . '/' . $bgcacheid;
$cachedfile = realpath(file_directory_temp() . '/' . $bgcacheid);
...
...
$lastchanged = filemtime( $cachedfile ); # was filectime() originally
...
}

Btw, I have Drupal 5.3 on Windows XP Pro, so the filepath to cache files has mix-slashes, for example:
/files/tmp\bg_ahfphq1f437rg1uiytqo68wetqrwe7r

Nitagob’s picture

upd: It was a mistake, to realpath(...) it.

But still, filemtime is better for me than filectime, see _notes at:
http://ru2.php.net/manual/en/function.filectime.php

And there should be added some check for file existence, I guess - to remove PHP error messages.

upd:

It looks so for now:

$lastchanged = (file_exists($cachedfile) ? filemtime( $cachedfile ) : false);

laszlo.laszlo’s picture

Nitagob,

I modified the image.php file, and after that no more PHP error messages. Thank you!

Nitagob’s picture

Don't give up, laszlo.laszlo - you can get some more PHP errors! ;))

At least, there are few after direct modification of cache or image files: when user requests image (via 'old' page) that was renamed/removed, and the cache purged - the user get black picture instead of error message and recommendation to update page, and there are PHP errors in log: "file not found", etc.

Still, there no any useful_programs without errors! :)

vacilando’s picture

Status: Active » Fixed

Good idea about checking for file existence there; applied now. Thanks to Nitagob.

Cheers,

Tomáš

Anonymous’s picture

Status: Fixed » Closed (fixed)

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