Better HN
topnewbestaskshowjobs
Log inSign up

scaturr

55 karma · joined Oct 20, 2014 (12y ago) · 13 submissions

https://github.com/brianium
Submissions

comment 11y ago · link · parent

I think this library could defer altering the window object until it is certain it is in a browser context. The original design goal was for a browser, but the issue has already come up on leveraging node-canvas to make it useful on the server as well:

https://github.com/brianium/watermarkjs/issues/11

comment 11y ago · link · parent

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 11y ago · link · parent

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 11y ago · link · parent

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 11y ago · link · parent

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 11y ago · link · parent

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 11y ago · link · parent

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.

8.

Show HN: Watermark.js – Functional ES6 lib for watermarking in the browser(brianium.github.io ↗)

46 points · by scaturr · 11y ago · 26 comments

9.

Show HN: Concurrent BDD in PHP(github.com ↗)

7 points · by scaturr · 11y ago · discuss

10.

Show HN: Leo – Next level assertion and matcher library for PHP(peridot-php.github.io ↗)

3 points · by scaturr · 11y ago · discuss

11.

A Peridot plugin to simplify testing Silex applications in PHP(github.com ↗)

1 points · by scaturr · 12y ago · discuss

comment 12y ago · link · parent

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 :)

13.

Peridot – the highly extensible, highly enjoyable, PHP testing framework(peridot-php.github.io ↗)

14 points · by scaturr · 12y ago · 2 comments