… | |
… | |
289 | uses it), then the in-memory copy us returned instead. |
289 | uses it), then the in-memory copy us returned instead. |
290 | |
290 | |
291 | =item load_uc $path |
291 | =item load_uc $path |
292 | |
292 | |
293 | Load uncached - same as load, but does not cache the image, which means it |
293 | Load uncached - same as load, but does not cache the image, which means it |
294 | is I<always> loaded from the filesystem again. |
294 | is I<always> loaded from the filesystem again, even if another copy of it |
|
|
295 | is in memory at the time. |
295 | |
296 | |
296 | =cut |
297 | =cut |
|
|
298 | |
|
|
299 | sub load_uc($) { |
|
|
300 | $self->new_img_from_file ($_[0]) |
|
|
301 | } |
297 | |
302 | |
298 | sub load($) { |
303 | sub load($) { |
299 | my ($path) = @_; |
304 | my ($path) = @_; |
300 | |
305 | |
301 | $_IMG_CACHE{$path} || do { |
306 | $_IMG_CACHE{$path} || do { |
302 | my $img = $self->new_img_from_file ($path); |
307 | my $img = load_uc $path; |
303 | Scalar::Util::weaken ($_IMG_CACHE{$path} = $img); |
308 | Scalar::Util::weaken ($_IMG_CACHE{$path} = $img); |
304 | $img |
309 | $img |
305 | } |
310 | } |
306 | } |
311 | } |
307 | |
312 | |