Image "generation" using php

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

Image "generation" using php

Post by ConceptDestiny »

Hi folks,

I'm trying to find a method which "prints" an image into a page, thus preventing somebody from actively selecting the image and viewing its properties. I've heard there's a way, but I've yet to find it... I don't suppose you guys know of a method? Perhaps php dynamic image generation? :/
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Image "generation" using php

Post by PaxBritannia »

You could use try and use CSS to link to it, but they would still be able to find it's source by looking at the code.

Maybe using Javascript to alter the DOM, so it won't appear in the source code?

pax.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Image "generation" using php

Post by Jackolantern »

There is no 100% way to do it. All you can do is slow down the most inexperienced web users. The bottom line is that to display an image on a webpage through HTML, that image must be downloaded to the user's browser, and with certain browsers (or plugin tools with other browsers) there is no way to hide anything. You could only make it a bit more difficult and hope that most users don't bother.

Note however that I said "HTML". An alternative would be to load up simple Flash applications that do nothing but show your image. Almost every internet-connected computer has Flash installed, so the user would likely not even know the difference unless they right-clicked it. The downside of this would be that most mobile devices do not have native Flash players, so they would not be able to see your image. I guess it depends on your audience and if the site was going to be trafficked by mobile devices.

What exactly are you trying to do? There may be another option. Are you trying to keep users from saving the image or getting the direct link to it? If so, hiding the url in the source will have no effect, since virtually all browsers allow users to save the image or copy the url by right-clicking the image. If it is not that you are trying to do, there could be alternatives, though.
The indelible lord of tl;dr
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Image "generation" using php

Post by PaxBritannia »

Hiding it in CSS, will make it not right-clickable, or dragable.

Essentially, aslong as they can see the page, there is no way to prevent it from being downloaded. The best you can do is prevent them from hot-linking, and save some bandwidth.

Once clever 'trick' is to alter your htaccess file so all external requests for the images get replaced by a "this image was stolen from www.ConceptDestiny'sAwesomeSite.com" placeholder image.

pax.
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Image "generation" using php

Post by Xaleph »

It`s impossible what you ask. And i mean, impossible. All tips provided here are good measurements to prevent most common users from downloading the original source but there is always, i mean, ALWAYS a way to get the source. Even if it comes down to making a screenshot to just paste the image in MS Paint or whatever.

You could use flash, redirect using Htaccess or block right mouse clicking in Javascript ( all are viable options ) but then again, why bother? Because you break the user experience by doing so. The user does not expect this to happen, so when it does, it means the user will have a bad experience. Now, that`s something you dont want right?
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

Re: Image "generation" using php

Post by ConceptDestiny »

yeah, I didn't think there was a way to prevent it completely, however I'm looking to obscure it and make it harder to find.

Well, the idea was to obscure the player's ability to directly select the image in order to view the properties.

My thoughts were perhaps making it a background, with an invisible div layer over it to prevent them from "selecting" the image.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Image "generation" using php

Post by Jackolantern »

Just out of curiosity, what are you trying to protect and why? Image-selling has long been a thriving business online, and there are many different strategies for protecting your content, but none of them involve showing the full image to the user through the webpage and trying to prevent them from downloading it.

It just depends on what you are trying to do, and why you are needing to protect the image, so some more background on what you are wanting to accomplish would be helpful.

EDIT: I actually happen to know a decent amount about this because my wife is an artist who is always looking for quality reference picture libraries online. I have seen about 3 different models for how they manage these types of businesses. The first is that they only offer thumbnails, and you must sign-in and/or subscribe or pay to get the full-sized, full-quality image, at which point you don't care if they download it. The second is that the picture has a water mark running all through it. This is probably the favorite strategy for sites selling images that are directly consumed for their purpose, such as textures for 3D models (doesn't work as well for reference pictures, since the artist can still see them fine). The third I have seen is they provide a Flash or Silverlight client that connects to an authentication server and sends "layers" of quality of the image to the client to be assembled there. Of all 3 methods, this one likely is the most work for the least security. I have only seen something like it once.
The indelible lord of tl;dr
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

Re: Image "generation" using php

Post by ConceptDestiny »

It's cool.

I've decided to recode the way the images are displayed. As royal python morphs consist of base colours, patterns and detail markings, i've divided these into seperate layers; base layer, pattern layer and detail layer, arranged in divs.
Post Reply

Return to “Advanced Help and Support”