?
Solved

PHP slice image and output embedded in HTML

Posted on 2015-01-23
14
Medium Priority
?
238 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 1500 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 84

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 84

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
 
LVL 84

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 84

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 84

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

850 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