• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4309: Updatet Images are not re-rendered by ImagePlugin

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension ImagePlugin Normal Confirmed   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

ImagePlugin does not update new images attached to a topic.

E.g. if a new version of screenshot is uploaded by a user, the resized image within the topic (created by ImagePlugin) remains with the old image.

-- TWiki:Main/CedricWeber - 27 Jun 2007

Sounds like ImagePlugin could do with an attachhandler.

-- TWiki:Main.SteffenPoulsen - 16 Sep 2007

I've just come across this bug. I've written a patch. Note that the patch uses TWiki::Func::getPubDir(), which is deprecated. It's currently a bit of a hack: I'm not sure what extensions ImagePlugin allows, so I just put the popular ones in there for the regex. As it does an unlink: use at your own risk smile

sub afterAttachmentSaveHandler {
    # do not uncomment, use $_[0], $_[1]... instead
    ###   my( $attrHashRef, $topic, $web ) = @_;
    forceImageThumbnailRefresh($_[1], $_[2]);
}

# CFLEWIS | 2008-04-10 | Force a refresh of an image thumbnail by
# deleting the thumbnail.
sub forceImageThumbnailRefresh
{
    my $topic = shift;
    my $web = shift;
    
    my $path = TWiki::Func::getPubDir() . "/" . $web . "/" . $topic . "/";
        
    opendir(ATTACHDIR, $path);
    
    my @files = readdir(ATTACHDIR);
    
    closedir(ATTACHDIR);
    
    foreach my $taintedFile (@files)
    {
        my $file;
        
        if ($taintedFile =~ m/(.*)/)
        {
            $file = $1;
        }
                
        if ($file =~ m/^_(\d*)___(.*)\.(jpg|png|gif|tif)$/)
        {
            # CFLEWIS | 2008-04-10 | Image plugin wrote this
            unlink $path . $file;
        }
    }
}

-- TWiki:Main.ChrisFLewis - 10 Apr 2008

ItemTemplate
Summary Updatet Images are not re-rendered by ImagePlugin
ReportedBy TWiki:Main.CedricWeber
Codebase 4.0.3
SVN Range TWiki-4.1.2, Mon, 25 Jun 2007, build 14278
AppliesTo Extension
Component ImagePlugin
Priority Normal
CurrentState Confirmed
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-04-10 - ChrisFLewis
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback