104c104
< if ($attachment->{name} =~ /\.(.+)$/) {
---
> if ($attachment->{name} =~ /\.(.+?)$/) {
183a184,185
> $this->{listsvg} = $params->{listsvg};
> $this->{noimages} = $params->{noimages} || 'no images found';
228,229c230,231
< my $img = "$this->{igpDir}/$entry->{name}";
< my $thumb = "$this->{igpDir}/thumb_$entry->{name}";
---
> my $img = "$this->{igpDir}/$entry->{name}" . ( ( $entry->{name} =~ /\.svgz?$/ )? '.png' : '' );
> my $thumb = "$this->{igpDir}/thumb_$entry->{name}" . ( ( $entry->{name} =~ /\.svgz?$/ )? '.png' : '' );
279,283c281,285
< my $firstFile;
< my $lastFile;
< my $nextFile;
< my $thisImage;
< my $prevFile;
---
> my $firstImg;
> my $lastImg;
> my $nextImg;
> my $thisImg;
> my $prevImg;
294,298c296,300
< $firstFile = $image->{name} if ! $firstFile;
< $prevFile = $image->{name} if $state == 0;
< $thisImage = $image if $state == 1;
< $nextFile = $image->{name} if $state == 2;
< $lastFile = $image->{name};
---
> $firstImg = $image if ! $firstImg;
> $prevImg = $image if $state == 0;
> $thisImg = $image if $state == 1;
> $nextImg = $image if $state == 2;
> $lastImg = $image;
300,302c302
< return &renderError("unknown file $filename") if !$thisImage;
<
< my $viewUrl = &TWiki::Func::getViewUrl($this->{web}, $this->{topic});
---
> return &renderError("unknown file $filename") if !$thisImg;
307,308c307,310
< "\n";
< if ($firstFile && $firstFile ne $filename) {
---
> " &TWiki::Func::getViewUrl($thisImg->{IGP_web}, $thisImg->{IGP_topic}) .
> "\" title=\"Thumbnails\" />\n";
> if ($firstImg->{name} && $firstImg->{name} ne $filename) {
310c312,314
< "{id}&filename=$firstFile#igp$this->{id}\" title=\"$firstFile\" />\n";
---
> " &TWiki::Func::getViewUrl($firstImg->{IGP_web}, $firstImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$firstImg->{name}#igp$this->{id}\" title=\"$firstImg->{name}\" />\n";
312c316
< if ($lastFile && $lastFile ne $filename) {
---
> if ($lastImg->{name} && $lastImg->{name} ne $filename) {
314c318,320
< "{id}&filename=$lastFile#igp$this->{id}\" title=\"$lastFile\" />\n";
---
> " &TWiki::Func::getViewUrl($lastImg->{IGP_web}, $lastImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$lastImg->{name}#igp$this->{id}\" title=\"$lastImg->{name}\" />\n";
316c322
< if ($nextFile && $lastFile ne $filename) {
---
> if ($nextImg->{name} && $lastImg->{name} ne $filename) {
318c324,326
< "{id}&filename=$nextFile#igp$this->{id}\" title=\"$nextFile\" />\n";
---
> " &TWiki::Func::getViewUrl($nextImg->{IGP_web}, $nextImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$nextImg->{name}#igp$this->{id}\" title=\"$nextImg->{name}\" />\n";
320c328
< if ($prevFile && $firstFile ne $filename) {
---
> if ($prevImg->{name} && $firstImg->{name} ne $filename) {
322c330,332
< "{id}&filename=$prevFile#igp$this->{id}\" title=\"$prevFile\" />\n";
---
> " &TWiki::Func::getViewUrl($prevImg->{IGP_web}, $prevImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$prevImg->{name}#igp$this->{id}\" title=\"$prevImg->{name}\" />\n";
327,328c337,338
< $this->computeImageSize($thisImage);
< if (!$this->createImg($thisImage)) {
---
> $this->computeImageSize($thisImg);
> if (!$this->createImg($thisImg)) {
335c345
< . $this->replaceVars($this->{title}, $thisImage)
---
> . $this->replaceVars($this->{title}, $thisImg)
344,345c354,357
< if ($firstFile && $firstFile ne $filename) {
< $result .= "{id}&filename=$firstFile#igp$this->{id}\">first";
---
> if ($firstImg->{name} && $firstImg->{name} ne $filename) {
> $result .= " &TWiki::Func::getViewUrl($firstImg->{IGP_web}, $firstImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$firstImg->{name}#igp$this->{id}\">first";
350,351c362,365
< if ($prevFile) {
< $result .= "{id}&filename=$prevFile#igp$this->{id}\">prev";
---
> if ($prevImg->{name}) {
> $result .= " &TWiki::Func::getViewUrl($prevImg->{IGP_web}, $prevImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$prevImg->{name}#igp$this->{id}\">prev";
355,357c369,373
< $result .= " | [[$this->{web}.$this->{topic}][up]] | ";
< if ($nextFile) {
< $result .= "{id}&filename=$nextFile#igp$this->{id}\">next";
---
> $result .= " | [[$thisImg->{IGP_web}.$thisImg->{IGP_topic}][up]] | ";
> if ($nextImg->{name}) {
> $result .= " &TWiki::Func::getViewUrl($nextImg->{IGP_web}, $nextImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$nextImg->{name}#igp$this->{id}\">next";
362,363c378,381
< if ($lastFile && $lastFile ne $filename) {
< $result .= "{id}&filename=$lastFile#igp$this->{id}\">last";
---
> if ($lastImg->{name} && $lastImg->{name} ne $filename) {
> $result .= " &TWiki::Func::getViewUrl($lastImg->{IGP_web}, $lastImg->{IGP_topic}) .
> "?id=$this->{id}&filename=$lastImg->{name}#igp$this->{id}\">last";
371c389
< . $this->replaceVars($this->{format}, $thisImage)
---
> . $this->replaceVars($this->{format}, $thisImg)
384,387c402,405
< if (!@{$this->{images}}) {
< my $msg = "no images found";
< #writeDebug($msg);
< return &renderError($msg);
---
> if ( !@{$this->{images}} ) {
> if ( $this->{noimages} && ( $this->{noimages} ne 'off' ) ) {
> return &renderError($this->{noimages});
> }
407c425
< . &TWiki::Func::getScriptUrl($this->{web}, $this->{topic}, "view")
---
> . &TWiki::Func::getScriptUrl($image->{IGP_web}, $image->{IGP_topic}, "view")
409c427,428
< . "{imagesPubUrl}/thumb_$image->{name}\" "
---
> . "{imagesPubUrl}/thumb_$image->{name}"
> . ( ( $image->{name} =~ /\.svgz?$/ )? '.png' : '' ) . '" '
500c519,521
< next if $image->{name} =~ /svg$/i;
---
> if ( ! $this->{listsvg} ) {
> next if $image->{name} =~ /svg$/i;
> }
714c735,736
< $format =~ s,\$imageurl,$this->{imagesPubUrl}/$image->{name},gos;
---
> my $prev = $image->{name}.( ( $image->{name} =~ /\.svgz?$/ )? '.png' : '' );
> $format =~ s,\$imageurl,$this->{imagesPubUrl}/$prev,gos;
739c761,763
< my $target = "$this->{igpDir}/$prefix$image->{name}";
---
> my $target = "$this->{igpDir}/$prefix$image->{name}" .
> ( ( $image->{name} =~ /\.svgz?$/ )? '.png' : '' );
>