문제

I'm building functionality that allows users to upload an image, then crop it to a square (for profile pictures etc...)

Currently, the process works like this:

  • User selects image from hd
  • Image is uploaded to S3
  • S3 Path is sent back to view, and image with jCrop is shown
  • On submit button being clicked, my controller action gets the coords set above

Now I'd like to crop this image to the given coords (note- I'm using lpatters fork of node-imagemagick as it contains 'offset'

Unfortunately, .crop only accepts a path - which we don't have, since it's hosted on S3 at this point.

Is there any workaround?

I saw tmp, but this may be a little overkill?

도움이 되었습니까?

해결책

What about using some of the other entry points such as "resize" that then allow you to provide the custom arguments? I'm using streams in this code: https://github.com/jeffwilcox/4th-cloud/blob/master/lib/webserver.js#L542

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top