scaturr

Joined 12 years ago

Karma
55
Submissions
13
Member since
Oct 20
https://github.com/brianium
View on Hacker News

Recent submissions

Comment · 11 years ago
Comment · 11 years ago
I am seeing the same arguments made :) - Watermarking an on-page element does allow the original image to be access quite easily.

However, I will reiterate it is pretty useful to watermark from a user upload. You can watermark an image from the user's local machine - upload it, then display it. All from the client. I don't believe there is any easy in circumventing this method - if there is I would love to see it :)

Comment · 11 years ago
Yes. Absolutely. The library includes a blob() function for converting a watermarked image to a blob for use with FormData. The site has a demo that does just this for uploading to S3. Any browser supporting File API, FormData, and typed arrays should have no problems. IE 10 is the earliest IE that supports these APIs out of the box, but there are polyfills for IE9. The other modern browsers have supported these APIs for a while now.
Comment · 11 years ago
Watermarking by urls or existing images would leave the non-watermarked image open - you are correct. This case is still fine for most users, but watermark.js also allows the use of file inputs. You can grab an image from a file input, then watermark, then upload it. This would leave the non-watermarked image closed off to anyone else. This would be handy if you need to generate watermarks in a CMS backend or some other administrative tool
Comment · 11 years ago
Well what if you batch it in the browser? It is quite possible to use file inputs to generate watermarked images without ever storing the image you are watermarking, and then upload the result.
Comment · 11 years ago
You are correct. This would serve the purpose for many users who don't know how to go digging around for urls in JS, but more importantly its a tool for generating them on the client so a server doesn't have to - say for a CMS?
Comment · 11 years ago
How so? Being able to generate watermarks in the browser is one less thing a server has to do right? Especially if that server is in a shared environment without image libraries or lacks tools for uploading things concurrently.
Comment · 12 years ago
Thanks for your feedback!

PHPUnit is an awesome tool (I even started https://github.com/brianium/paratest to get a little more out of it). Behat is equally awesome.

However we wanted something that was a little easier to extend, in a variety of ways. We spend a lot of time writing JavaScript tests with Mocha and Jasmine for JS apps that consume our PHP APIs, and we really enjoy that style of testing.

This is our way of bringing that style to PHP, and we think its a great tool for new codebases.

Thanks again for the comment :)

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton