Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3   Go Down

Author Topic: Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features...  (Read 53799 times)

0 Members and 1 Guest are viewing this topic.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

russell235

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24

--* Non-image files can now use custom intermediate images if uploaded (default normal_ prefix)

I haven't gotten this part to work at all.  I can't see in the files provided where you would have coded this change.  Are you certain you included the correct file for this?
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

It works basically like uploading a thumbnail for videos/files, except you use the normal_ prefix instead of thumb_.

This does not apply to videos (no image overlay before video plays) - that requires a flash player.  This is in reference to having a picture to click on instead of a plain file-icon when hosting zips/documents etc.
Logged

russell235

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24

It works basically like uploading a thumbnail for videos/files, except you use the normal_ prefix instead of thumb_.

I assumed that.  I uploaded a normal_ and thumb_ file, but only the thumb_ shows as intermediate image.  And I can't find anywhere in your code that it should display the normal_ file for the intermediate.  so that's why I asked if you were sure there wasn't another change that maybe didn't get included in this package.   :-[

Even though I know it's not the major feature of your mod, this is the part that interests me most because I don't like the little thumbs used as intermediate images.
Logged

russell235

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24

i guess i can't edit my post, but wanted to add that I tried on a .zip file
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

The feature is in the imagix.php (root one).  It replaces the theme_html_picture() function with a modified one.  However, if an updated one already exists in the theme.php, it will be ignored.

You probably have the function in your theme.php - if you don't mind, removing it should fix the issue.  Or you can add the change yourself:

Find: elseif ($mime_content['content']=='document')
Code: [Select]
} elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        if(file_exists(str_replace($CONFIG['thumb_pfx'], $CONFIG['normal_pfx'], $pic_thumb_url))) $pic_thumb_url=str_replace($CONFIG['thumb_pfx'], $CONFIG['normal_pfx'], $pic_thumb_url);
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
        $pic_html=imaginx($pic_html);
    }
Logged

russell235

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24

you are right.  that was exactly the help that i needed.  thank you very much.  :)
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

     Slight problem with the mod I discovered recently.  The mod seemingly just stop working for no apparent reason and reduce the image view size to 1×1px.

     The cause turned out to be the filepath of the image, which might contain a space but shows up as %20 from the URL.  The code does not know how to handle this and renders a faulty image.

     This has been corrected and the download has been updated.  For those who have the previous version, simply replace the root imagix.php (not the theme one).

     Download: Coppermine Anti-Copy 1.02

Apologies, but I still haven't been able to get around the resource consumption.  The mod is based entirely on the PHP image functions, which by nature seem to use heavy amounts of memory (directly proportional to the size of the image itself; smaller images = less memory use).  If anyone has any tips on how to around this that'd be great.

Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

Hi all,

I want to install your great Mod on my site (www.volleyball.lu/fotogallery/) but I tested it on an offline version of my gallery. There was the problem that no image was shown at all, even Tumb, Itermediate, an Fullsize.

Could someone give me a hint or more detailed instructions how do this Mod?

Thanks in advance. Regards, Francis
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

Hi is the size of the image correct? Describe a bit more what you mean.

If the sizes are correct and it is only the image which is blank, try raising the time setting on the image generator file (one with really random-lettered name) as this means the image generator is having too narrow a timeslot for your server to extract the image.

It'd also help if you could set up a seperate temporary gallery to show what problems you are experiencing.
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

Hi, infact the image size should be correct (e.g. the thubs are schon 150x100px) but the original image in background isn't shown at all.
Do you mean this ($marx=15;) variable?
For the moment I have jhust one CPG install in production. I will try to macke a copy.
Thanks
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

Hi, I prepared a test CPG gallery with your mod. you will find it under test.volleyball.lu. There is the same phenomen. Maybe this will help.

Thanks for your time.
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

Hi sorry for the delay.

Does your server support Apache? It appears that the image generator file (random-looking extension) is not being recognized as a jpeg filetype.
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

Hi sorry for the delay.

Does your server support Apache? It appears that the image generator file (random-looking extension) is not being recognized as a jpeg filetype.
Hi, no problem. I think the server supports Apache. I found in the phpinfo following line:
Server API    Apache 2.0 Handler
There are also a lot of parameter under the point apache2handler and Apache Environment.

But what they all means, no idea  ???
Francis
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

You should not have to change anything then... The code that lets your server recognize the filetype is in the .htaccess file in the albums/ folder.  Maybe you forgot to copy it over?
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

You should not have to change anything then... The code that lets your server recognize the filetype is in the .htaccess file in the albums/ folder.  Maybe you forgot to copy it over?
Hi, I copied the file in the albums location. If I try to enter the URL for a pic under albums, I get with te htacces file a 500 server error. If I delete the htacces I can acces this file. So it seams that the htacces works.
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

Hi, try copying the .htaccess to the root gallery folder as well.
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

Hi, try copying the .htaccess to the root gallery folder as well.
done but now I get when access the page an 500 error
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

Can I see the code you put in the .htaccess file?
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop

Can I see the code you put in the .htaccess file?
Code: [Select]
#Set your site to recognize your custom php file, if you change the extension

AddType application/x-httpd-php .jfASjaweaxSPAt

AddHandler application/x-httpd-php .jfASjaweaxSPAt

#Deny access to image files for those who figure out the code

RewriteEngine on

RewriteBase /gallery/albums/ #Path to pictures

RewriteCond %{HTTP_HOST} !^http://(www.)?sitename.com/.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://(www.)?sitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https?://12.34.56.7890/.*$ [NC]  # This is site ip address, optional

RewriteCond %{REQUEST_URI} ^.*\.(gif|GIF|jpe?g|png|JPE?G|PNG)$

ReWriteRule (.*) /404 [L] # Where to send those snooping bastards...
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.035 seconds with 20 queries.