1
tomodea
EXTGALLERY - Suggested fix for problem when downloading original image
  • 2010/9/8 9:28

  • tomodea

  • Just popping in

  • Posts: 47

  • Since: 2008/2/19


There is a logic error in public-download.php when you have chosen to use digital watermarks.

When a user uploads a low resolution photo, extgallery will store 3 versions of the image:
1. thumb size.
2. medium size.
3. original.

For higher resolution photos, there will also be a large size version.

If you are using digital watermarks the watermark will be applied to the thumb size, the medium size and the large size images but not the original image.

The relevant statements are:
if($photo->getVar('photo_havelarge')) {
    if(
$permHandler->isAllowed($xoopsUser'public_download_original'$photo->getVar('cat_id')) && $photo->getVar('photo_orig_name') != "") {
        
$photoName "original/".$photo->getVar('photo_orig_name');
    } else {
        
$photoName "large/large_".$photo->getVar('photo_name');
    }
} else {
    
$photoName "medium/".$photo->getVar('photo_name');
}


This means that the original image will only be downloaded if we have a large size version otherwise the user will get the medium size version. If the medium size version does not have a digital watermark, the user will not notice the difference but if we are using digital watermarks then the user will get an “original” with a watermark.

My suggested changes are:
if($permHandler->isAllowed($xoopsUser'public_download_original'$photo->getVar('cat_id')) && $photo->getVar('photo_orig_name') != "") {
        
$photoName "original/".$photo->getVar('photo_orig_name');
    } else {
        if(
$photo->getVar('photo_havelarge')) {
            
$photoName "large/large_".$photo->getVar('photo_name');
        } else {
            
$photoName "medium/".$photo->getVar('photo_name');
        }
    }

Regards, Tom O’Dea
Regards, Tom O'Dea
Melbourne, Australia

2
Mamba
Re: EXTGALLERY - Suggested fix for problem when downloading original image
  • 2014/2/17 14:26

  • Mamba

  • Moderator

  • Posts: 11256

  • Since: 2004/4/23


Tom, nice catch!

It will be added to SVN (see this response)
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Login

Who's Online

69 user(s) are online (51 user(s) are browsing Support Forums)


Members: 0


Guests: 69


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits