Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

cfs-s3: photo is not uploaded completely when the store uses a transformWrite with gm #210

Closed
ghost opened this issue Mar 23, 2014 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 23, 2014

Only about 50% of the data of the photos gets uploaded when I use the S3 storage adapter. The filesystem storage adapter works fine.

My store and collection configuration:

var s3eventPhotosThumbnails = new FS.Store.S3('eventPhotosThumbnails', {
  region: Meteor.settings.AWS.region,
  accessKeyId: Meteor.settings.AWS.accessKeyId,
  secretAccessKey: Meteor.settings.AWS.secretAccessKey,
  bucket: 'photos',
  ACL: 'public-read'
  folder: 'thumbnail/',
  transformWrite: function(file, readStream, writeStream) {
    this.gm(readStream, file.name)
      .resize(64, '64^')
      .gravity('Center')
      .crop(64, '64^')
      .stream()
      .pipe(writeStream);
  }
}));

eventPhotos = new FS.Collection('eventPhotos', {
  stores: [s3eventPhotosThumbnails],
  filter: defaultPhotoFilter
});
@raix
Copy link

raix commented Mar 24, 2014

I've just bumped new version of the cfs-s3 package - could you give it a go?
Let me know if it still fails

@ghost
Copy link
Author

ghost commented Mar 24, 2014

Most of the images upload completely. But here is an example that fails every time.

nosleepin_logo

This is what gets uploaded:
nosleep_logo_upload_fail

With the filesystem storage adapter this image works fine.

@raix
Copy link

raix commented Mar 24, 2014

Strange - I'm not sure but its seems to be the conversion - The result is a cleared png file - but its intact and fully uploaded.
what happens if you remove the crop (it seems to do nothing)?
.resize(64, 64)

@ghost
Copy link
Author

ghost commented Mar 24, 2014

I found a fix for the issue. I will make a pull request soon.

@raix
Copy link

raix commented Mar 24, 2014

@sanjo I've merged the fix, thanks again! can we close this issue then?

@ghost
Copy link
Author

ghost commented Mar 24, 2014

Yes. Thanks for the fast response.

@ghost ghost closed this as completed Mar 24, 2014
@raix
Copy link

raix commented Mar 24, 2014

no prop, nice catch btw. its live on mrt - thank you for doing some qa test on the fresh code :)

@raix raix added the devel label Mar 24, 2014
@raix raix modified the milestone: CollectionFS V2 - Final Mar 24, 2014
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant