brunobar79 / J-I-C

J I C is a Javascript Image Compressor using HTML5 Canvas & File API that allows you to compress your jpeg & png images before uploading to the server (100% client-side and no extra libraries required!)
http://makeitsolutions.com/labs/jic/
MIT License
857 stars 196 forks source link

compression not working in firefox #51

Open SachinLoonia19 opened 7 years ago

SachinLoonia19 commented 7 years ago

Compression is working in chrome, but some unknown reasons not working in firefox, if i debug the js for first time i can able to upload image otherwise image becomes corrupted. This is the "https://s3-us-west-2.amazonaws.com/cdndev.mylyapp.com/uploadeddocs/gallery/motherdaughtersymboltattooideas10022201753516.jpg" link of image.

Here is the code snippet.

                    i = new Image();
                    c = new Image();
                    t = new Image();
                    if (file.type == "image/png") {
                        output_format = "png";
                    }
                    i.src = base64;// original image converted in base64

                    c.src = jic.compress(i, objVariables.ImageQuality, output_format, i.width, i.height).src;
                    var obj=objUtility.compressedHeightWidth(i);
                    t.src = jic.compress(i, objVariables.ImageQuality, output_format, parseInt(obj.Width), parseInt(obj.Height)).src;
                    var blobs = [];

                    blobs.push({ src: i.src, path: S3GalleryBucketOriginal});
                    blobs.push({ src: t.src, path: S3GalleryBucketCompress });
                    blobs.push({ src: c.src, path: S3GalleryBucket});
martinop commented 7 years ago

I have this problem too :/