From 8faf7951d0589a39fa6dbed5b9f912eb7c892580 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 23 Apr 2007 05:13:59 +0000 Subject: [PATCH] deleting a file from an Image Storage location did not delete the thumbnail --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Storage/Image.pm | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index ff00c5eda..b3e515148 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,6 +12,8 @@ - Added better error handling in asset instanciation. - fix: Image::Magick->Scale does nothing if given dimensions < 1, so make sure they are large enough when generating thumbnails in Storage/Image.pm + - fix: Deleting a file from an Image storage location did not delete the + thumbnail as well. (perlDreamer Consulting, LLC) - fix: WebGUI::Image->new doesn't obey width and height settings (Martin Kamerbeek /Oqapi) http://www.plainblack.com/bugs/tracker/webguiimage-new-doesnt-obey-width-and-height-settings - fix: Calendar week view didn't display events correctly if they happened on diff --git a/lib/WebGUI/Storage/Image.pm b/lib/WebGUI/Storage/Image.pm index dc84d4c05..277286051 100644 --- a/lib/WebGUI/Storage/Image.pm +++ b/lib/WebGUI/Storage/Image.pm @@ -95,6 +95,27 @@ sub copy { return $self->SUPER::copy($newStorage, $filelist); } +#------------------------------------------------------------------- + +=head2 deleteFile ( filename ) + +Deletes the thumbnail for a file and the file from its storage location + +=head3 filename + +The name of the file to delete. + +=cut + +sub deleteFile { + my $self = shift; + my $filename = shift; + $self->SUPER::deleteFile('thumb-'.$filename); + $self->SUPER::deleteFile($filename); +} + + + #------------------------------------------------------------------- =head2 generateThumbnail ( filename, [ thumbnailSize ] )