doudong8713
doudong8713
2013-07-28 15:32

只创建我的网站可以读取的图像文件格式

已采纳

I'm considering writing my own image file format for my site. Why? Well, the site is going to include comics that only subscribers can read, and I want to make it a little difficult for someone to drag and drop the image and spread it around. Is there a better way of doing this, or is this a way I should investigate further? If so, how would one go about doing this?

I've read there could be a way in PHP with doing this, but unsure how to go about it if this is a good solution.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dsqa6272 dsqa6272 8年前

    It's impossible to completely prevent your images from being stolen, but you can make the process harder.

    The following method will make the real image unreachable unless checked from the source. You can use the original image as a background & put a transparent-blank file over it that matches the size of the real image.

    Example:

    <div id="image1" style="background-image: url(originalImage.jpg);">
        <img src="blank.gif" height="250px" width="300px">
    </div>
    

    So, when the image is right-clicked, it will be the blank.gif that can be reached.

    View this post for some other ideas.

    An alternative solution would be to use PHP's GD Library. Using this method, you can add a watermark on all your images.

    Hope this helps!

    点赞 评论 复制链接分享

相关推荐