Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

resize image before upload to db

Hi
Obviously I cannot test what is happening with iOS but on the android phone, the error was:
Uncaught TypeError: Illegal constructor
dataURItoBlobUpload.js:16
reader.onload

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

resize image before upload to db

Thank you, will be tested.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

resize image before upload to db

Hello! We reproduced this problem, but could you also check are there any changes in your DB--Files when you upload images from each device? I mean could you test one more time this app from your devices and see if files uploaded in your DB, with what names, etc.?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

resize image before upload to db

Hi again,

"iPhone 4 with iOS 6- using camera or browsing previews fine. Upload service completes successfully. Trying to view image is broken. An image download direct form Appery database says "Invalid image"" - in your JS asset replace code:

codefunction dataURItoBlob(dataURI) {
var binary = atob(dataURI.split(',')[1]);
var array = [];
for(var i = 0; i < binary&#46;length; i++) {
array&#46;push(binary&#46;charCodeAt(i));
}
return new Blob([new Uint8Array(array)], {type: 'image&#47;jpeg'});
}/code
with the following:
codefunction dataURItoBlob(dataURI) {
var byteString = atob(dataURI&#46;split(',')[1]);
var ab = new ArrayBuffer(byteString&#46;length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString&#46;length; i++) {
ia = byteString&#46;charCodeAt(i);
}
return new Blob([ab], {type: 'image&#47;jpeg'});
}/code

"Android phone (android 4.1.2 with Chrome 18.0.x) -Upload button does nothing and no photo gets to database." - please try to update Chrome version.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

resize image before upload to db

Hi
I made the code change and the iPhone uploads an image. However, taking the photo with phone upright (portrait orientation) displays the image preview with the correct orientation, but saves it in the database rotated counter clockwise 90 degrees.
https://api.appery.io/rest/1/admin/fi...

(I'll be deleting this file in a bit)

I tested android phone again with chrome (without upgrade) and no change in behavior. I also tested android browser this time and it displays same behavior...that is- nothing happens when upload is clicked.

I updated chrome on android phone and now it fails in a different way. Screen says "failed to open selected file" There is no error in console log. After further testing with other camera app (not manufacturer installed) they all work ok so this new issue much be a camera specific problem

Test of android tablet still works ok and image is not rotated.

To sum up, android browser on android 4.x phone fails. iPhone image gets rotated when saved. I can live with android browser issue if I have to (although in theory it should work). The iphone issue needs a solution however. Any ideas why this might be happening? It's strange that it would preview ok but end up in database wrong.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

resize image before upload to db

Hi Sean,

Sorry for the delay, it's not that ease to answer your questions. The testing will take some time.

Sean Kelley
Posts: 0
Joined: Thu Oct 11, 2012 2:25 pm

resize image before upload to db

no problem! I appreciate you sticking with me :-)

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

resize image before upload to db

Hi Sean,

We are still working on it.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

resize image before upload to db

Hello! Unfortunately no news for now... It might take up to couple of days. Someone will get back to you and update this post.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

resize image before upload to db

Hello! Sorry, could you remind app name? Is it shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?

Return to “Issues”