Best way to crop and upload image with express?
Asked Answered
D

2

5

i upload image on S3 server with knox on express.

I would like user could crop the image for this profile picture (like on facebook)

I heard about Jcrop for the user interface and imagemagick for the server. For you, what is the best way to do that ?

Sorry for my bad english.

Dubitation answered 19/6, 2012 at 14:3 Comment(0)
N
9

You can try to use nice library GraphicsMagick for node.js https://github.com/aheckmann/gm

and here is a link to test some function and so on http://aheckmann.github.com/gm/

var gm = require('gm')
  , resizeX = 200
  , resizeY = 400

gm('/path/to/image.jpg')
.resize(resizeX, resizeY)
.write(response, function (err) {
  if (err) ...
});
Nealon answered 19/6, 2012 at 14:37 Comment(0)
E
1

I know this answer is a little late, but I have been working on a module (called Picsee) that does just this, check it out here. It uploads photos, crops photos (you need a client-side library), and saves multiple versions based on your configuration. It uses GD, not Image- or GraphicsMagick.

There is also a demo app that demonstrates how to upload, crop, and save multiple versions of the image. And the example is using JCrop. Eventually I hope to add S3 support as well as several other features.

Elaterium answered 11/4, 2013 at 1:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.