S3 icon indicating copy to clipboard operation
S3 copied to clipboard

Image Resizing

Open ryanswapp opened this issue 9 years ago • 25 comments

This package is great! Thank you for your work on it.

I am using the package to upload images to S3 and would like to resize them before they get to S3. What would be the most efficient/correct way to do this?

ryanswapp avatar May 26 '15 13:05 ryanswapp

I'm also interested in this. Thanks

gibex avatar May 26 '15 13:05 gibex

I'm working on a small package that combine this package, image manipulation and upload to FS.

gibex avatar Jun 11 '15 15:06 gibex

Sweet, what's the github URL? Want me to collaborate?

Lepozepo avatar Jun 11 '15 15:06 Lepozepo

Give me few days to clean up the code.

gibex avatar Jun 12 '15 08:06 gibex

@gibex you meant few years ?

x5engine avatar Oct 04 '15 03:10 x5engine

@capensisma Oh snap.

reimertz avatar Oct 10 '15 19:10 reimertz

@reimertz Oh snap snap :D

x5engine avatar Oct 10 '15 19:10 x5engine

Lol

Lepozepo avatar Oct 10 '15 19:10 Lepozepo

@Lepozepo is here :D :+1:

x5engine avatar Oct 10 '15 19:10 x5engine

any updates on this issue?

yayanchika avatar Oct 31 '15 02:10 yayanchika

Is there any easy way to resize image before uploading to S3? I tried to use lepozepo:s3 with https://atmospherejs.com/thinksoftware/image-resize-client but this approach doesn't work. I don't help any experience with meteor so any help is appreciated.

yayanchika avatar Oct 31 '15 05:10 yayanchika

Just thinking out loud here... it would be bit delayed but couldn't you kick off a AWS Lambda job to do this work? Maybe upload to temp bucket then Lambda job runs, does image work and moves image to live bucket then whacks temp bucket image. Or something like that.

dmarkrollins avatar Dec 20 '15 16:12 dmarkrollins

You totally could! I had never heard of Lambda, sounds useful. Maybe those functions can be a part of an extended version of this package. Or you can build them out yourself.

Thank you!

Marcelo Reyna 702 769 0639

On Dec 20, 2015, 8:08 AM -0800, [email protected], wrote:

Just thinking out loud here... it would be bit delayed but couldn't you kick off a AWS Lambda job to do this work? Maybe upload to temp bucket then Lambda job runs, does image work and moves image to live bucket then whacks temp bucket image. Or something like that.

— Reply to this email directly orview it on GitHub(https://github.com/Lepozepo/S3/issues/78#issuecomment-166132651).

Lepozepo avatar Dec 20 '15 16:12 Lepozepo

guys, there are services for this. very cheap ones. they're very powerful and stable and easy to use. take imgix for example.

KristerV avatar Mar 04 '16 07:03 KristerV

I completely agree, I personally prefer Cloudinary since it starts free.

Marcelo Reyna 702 769 0639

On Mar 3, 2016, 11:44 PM -0800, Krister [email protected], wrote:

guys, there are services for this. very cheap ones. they're very powerful and stable and easy to use. takeimgix(https://www.imgix.com/)for example.

— Reply to this email directly orview it on GitHub(https://github.com/Lepozepo/S3/issues/78#issuecomment-192165796).

Lepozepo avatar Mar 04 '16 14:03 Lepozepo

I used this library to resize, compress and get EXIF datas from images client-side before uploading them: https://github.com/blueimp/JavaScript-Load-Image.

As a side note, I'm currently moving from Cloudinary to S3 because it's not cheap at all: ~50$/month for >2Gb storage. Would love a service that just convert one image to another(s), like Cloudinary does, but doesn't store them... (did someone already tried https://cloudconvert.com/api?)

nicooprat avatar Jun 22 '16 16:06 nicooprat

Hey Nico, I'm planning to build a small inexpensive solution for these issues. Your upload would hit our servers, transform, then drop to your S3. I was thinking per image pricing would work at pennies or less per processed image. Is this something you would be interested in?

Lepozepo avatar Jun 22 '16 18:06 Lepozepo

I guess the main points would be the pricing and ease of use. Would it be possible to "hook" new image uploads in a S3 bucket and then create new thumbnails automatically (based on some kind of preferences managed in your service)? The best would be not to have to change my current workflow with this package ;)

nicooprat avatar Jun 23 '16 13:06 nicooprat

Definitely, I'll let you know as soon as I have something up to have you on beta ^_^

Lepozepo avatar Jun 23 '16 14:06 Lepozepo

Hey y'all I just implemented exactly that kind of resizing behaviour using Lambda on AWS which means no extra spending on transfers between servers. It took me a while to get it to work but finally it's working. If anyone is still insterested I can get you the walkthrough I followed along with the changes I had to make.

johnmore avatar Jul 26 '16 21:07 johnmore

Totally interested

jamgold avatar Jul 26 '16 21:07 jamgold

Basically it's this Blog Post, change the dimensions and compression as you like directly in the javascript file. The thing I had the most problems with was npm install which was strangely giving me some errors and then figuring out the AWS service roles! Basically you have to create a new IAM user and give him a role where its permissions are S3readandWrite as well as AWSLambdaExecute. After that everything clicked and my two connected buckets work seamlessly. I just added some code on my side to "fetch" the original uploaded url and get it on my database as its resized versions url & voilá. There's one catch though, Lambda cannot work with files bigger than 2.2 Mb. It won't break or anything simply won't do any resizing. It's a lambda limitation I had faced before so you should implement some "safety measures" on your own to prevent uploading images bigger than around 2 Mb.

johnmore avatar Jul 26 '16 22:07 johnmore

Awesome!

Lepozepo avatar Jul 27 '16 03:07 Lepozepo

@Lepozepo If you could implement something for us to have those kind of "safety measures" on the package itself it would be awesome. Just something simple such as limiting file size or file type would be great already. Thanks for a great package!

johnmore avatar Jul 27 '16 13:07 johnmore

@johnmore definitely want to put some more time into this :D

Lepozepo avatar Jul 27 '16 14:07 Lepozepo