Solved

PHP slice image and output embedded in HTML

Posted on 2015-01-23
14
144 Views
Last Modified: 2015-01-25
I am looking for a way to protect images from download. Figured out the simplest solution would be to slice-up large images into a tile, and if anyone is that persistent to get all those together, than I wish him all the luck :-)

I would need a PHP script that will take source image, split it into a tile of, say, 10x10, and output that in a HTML file as a data stream in a table.

script takes -> [INPUTIMAGE] -> divides it to 10x10 pieces -> returns 10x10 table and fills it with pieces

If there is not anything outright finished, some directions how to write my own script are welcome!


Thanks!
0
Comment
Question by:mrmut
  • 5
  • 5
  • 4
14 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40567002
Why do you think slicing it is going to keep someone from taking it.  All they need to do is use a screen capture and then parse it in any graphics program.

In any case if you really want to do the extra work, just use photoshop to create the slices.

Cd&
0
 

Author Comment

by:mrmut
ID: 40567128
For thousands of images? It can be done, but I think it isn't worth the while. Light discrepancies could create problem later on, so why not just do everything inside php script?
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40567190
You will find the php to do it here:
http://www.phpclasses.org/package/1804-PHP-Generate-HTML-to-present-images-divided-in-pieces.html

but Icannot understand why anyone would think adding overhead and bloat to a page makes sense to prevent something that is not preventable.  If some one wants the image then what you are doing is not going to make any difference, they will have the image with about 10 seconds effort.

Cd&
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40567243
I agree with Cd& on this, you're wasting your time.  If you put it on the screen, I can get it and you can't stop me.
0
 

Author Comment

by:mrmut
ID: 40567297
Thanks COBOLdinosau, that is the answer.

Re both comments above; if you take big picture in account you are both wrong. First of all, bloat is essentially nonexistent for gzipped HTML with embedded images. Secondly, it is enough of a deterrent. It takes time to get either native or well-croppped webshot. For the webserver load, that is of no importance for rarely run-scripts.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40567381
Are you sure?  This took about 15 seconds.
BigPicture
0
 

Author Comment

by:mrmut
ID: 40568029
Don't you see analog with computer software for which you still have software keys to enter?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40568321
I don't know what you mean.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40568329
@Dave,
Perhaps a case of Dunning–Kruger so there is no point is trying to educate if there is no desire to learn.

Cd&
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40568355
Could be.
0
 

Author Comment

by:mrmut
ID: 40569036
What I wanted to say that software packs have keys to enter, while you can easily both obtain the software and circumvent the trivial key protection where it serves only as a deterrent. What I am doing is the same, where the idea is to create a deterrent sufficient enough that most of the users won't be able to get to the complete 1:1 high resolution image, without some effort or satisfying themselves with browser-downsampled version. This is one of the methods, several of which should be implemented to achieve some filtering. This would dramatically reduce image stealing occurrence, and would make me easier to hunt down those that do. 3-4 vs hundreds.

Apart from that, I haven't yet had the privilege to be insulted on Experts Exchange, so I will take this opportunity to report you two. - You can take your garbage to newsgroups and free forums, but not on paying site for professionals.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40569307
Please do, they know us well.  Somehow, I thought we were the professionals and we don't agree with some of the things you have said.  Like this...
First of all, bloat is essentially nonexistent for gzipped HTML with embedded images.
That is simply wrong.  Images are Not downloaded as part of the HTML,  They are downloaded separately and if you download 100 slices (10x10) instead of one image, that is 99 more file requests than are needed.

I don't know about Cd& but I feel a little insulted that you're not interested in listening to us.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40569526
Before I get insulted I just consider the source and decide if I want to get down to a level where I have to ignore all I have learned by working with Firefox code on MDN an debating whether utter nonsense is worth a response. In this case the nonsense is not worthy of any comment.

However "but not on paying site for professionals" does require a response.  Your payment arrangement is with EE, not me.  I volunteer my time on this site.  If you want someone to confirm that your strange ideas are valid my current billing rate is $160 an hour but if you want I can make one of my staff available to tell you how great your ideas are for about half of that.  

BTW, If you want to complain, the easy way to do it is the "request attention" link at the bottom right of your question.


Cd&
0
 

Author Comment

by:mrmut
ID: 40569659
@Dave Baldwin - You are wrong. There would be only one request, bar css and scripts. Images would be embedded, as specified in original question.

@COBOLdinosaur - I made that comment mainly with EE in mind. Being a payed service, moderation is excellent, which I expect will kick in here. Re your approach, you can exercise it as much as you wish on those who will/have-to tolerate it.

*I will now respond to this thread anymore.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now