Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type is not defined #6

Open
jhuenges opened this issue Apr 23, 2015 · 3 comments
Open

Type is not defined #6

jhuenges opened this issue Apr 23, 2015 · 3 comments

Comments

@jhuenges
Copy link

image

The first image was uploaded using the following code:

        var image = event.target.files[0];
            UserProfilePicture.insert(image, function (err, fileObj) {
                if (err) {
                    // TODO: Show pretty message to the client
                    console.log(err);
                } else {
                    var userId = Meteor.userId();
                    var imageId = {
                        'profile.image': fileObj._id
                    };
                    Meteor.users.update(userId, {
                        $set: imageId
                    });
                }
            });

The second image was uploaded in the following way:

        var file = event.target.files[0];
        processImage(file, 300, 300, function (data) {
            console.log("processed image");
            var image;
            image = new FS.File(data);
            image.metadata = {
                date: Date.now(),
                ownerId: Meteor.userId()
            };

            UserProfilePicture.insert(image, function (err, fileObj) {
                if (err) {
                    // TODO: Show pretty message to the client
                    console.log(err);
                } else {
                    var userId = Meteor.userId();
                    var imageId = {
                        'profile.image': fileObj._id
                    };
                    Meteor.users.update(userId, {
                        $set: imageId
                    });
                }
            });
        });

As you can see, the second image (using your package) is missing the file type. Any idea?
Btw: If I open the image with paint it is still displayed as an image and the browser is able to display it aswell

@ccorcos
Copy link
Owner

ccorcos commented Apr 24, 2015

Hmm. I'm at a loss. Maybe its something with windows... Are you using IE?

The image should definitely be jpeg:

https://github.com/ccorcos/meteor-clientside-image-manipulation/blob/master/lib/processImage.coffee#L108

@jhuenges
Copy link
Author

I am using Chrome, but you might be right with windows. I ll have to test it on another system :)

@ccorcos
Copy link
Owner

ccorcos commented Apr 24, 2015

Yeah. Let me know. Check if the example works as well

Sent from my iPhone

On Apr 23, 2015, at 23:39, jhuenges [email protected] wrote:

I am using Chrome, but you might be right with windows. I ll have to test it on another system :)


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants