Android photo uploading (Slow and demented)
Posted: Tue Nov 25, 2014 6:42 pm
Hello
I am trying to get a photo's image data to to be placed into a variable and it does not seem to work.
Here is my script:
I resize the image to about 600x600 then I take a rect of dimensions 600x600 exactly and "export" the image into a variable.
This process takes about 100 milliseconds on my computer but 7-20 seconds on mobile and sometimes freezes.
The result is that it is taking about 7 to 20 seconds to use the export command. Also, when the screen returns from taking the photo using the phone's architecture, a black area is placed around the card that I cannot control (as noted in the included photos)
Does anyone have any experience using the export command on mobile?
Does anyone have any experience taking photos and saving them?
I am using LC 6.6.2, 6.7.1, 7.0, 7.0.1 RC 2 with samsung galaxy phone and tablet and Android Kitkat (4.2)
-Will
I am trying to get a photo's image data to to be placed into a variable and it does not seem to work.
Here is my script:
I resize the image to about 600x600 then I take a rect of dimensions 600x600 exactly and "export" the image into a variable.
This process takes about 100 milliseconds on my computer but 7-20 seconds on mobile and sometimes freezes.
Code: Select all
on UploadProfilePhoto
lock screen
log "UploadProfilePhoto:" && the millisecs
##Copies the Resize Image into the variable at the desired size file
set the JPEGQuality to kJPEGQuality
##Get the image to resize to a reasonable dimension size
get ResizeImage()
if it is "false" then
exit UploadProfilePhoto
end if
log "UploadProfilePhoto:" && the millisecs
##Get the modified rect
put getResizeRect() into tResizeImageRect
##Maintains aspect ratio
--export snapshot from grp "Snapshot Rect" of me to sPhoto as JPEG
log "Start Snapshot UploadProfilePhoto:" && the millisecs
export snapshot from rect tResizeImageRect of img "Resize Image" of me to sPhoto as JPEG
-- export snapshot from rect tResizeImageRect of img "Resize Image" of me at size sPhotoDBThumbnailSize to sThumbnail128 as JPEG
log "Start Snapshot UploadProfilePhoto:" && the millisecs
##MARK can create an activity here acknowleging the upload of the new photo
##Put the image into the image box on the left
put sPhoto into img "photo" of me
set the vis of img "Default" of me to false
ResetImageDimensions
unlock screen
end UploadProfilePhoto
Code: Select all
answer "" with "New Picture" and "Gallery"
##Lets them choose between taking a pic and using their gallery
if it is "New Picture" then
##iPhones can resize the image automatically
if the platform is "iphone" then
mobilePickPhoto "Camera", 600,600
else
mobilePickPhoto "camera"
end if
else if it is "Gallery" then
if the platform is "iphone" then
mobilePickPhoto "Album", 600,600
else
mobilePickPhoto "library"
end if
else
exit ChooseProfilePhoto
end if
lock screen
export the last image to binFile as JPEG
put binFile into img "Resize Image" of me
put binFile into img "Photo" of me
##Clear images made by the mobile device
if the short name of the last image is not "Profile Image" and \
the short name of the last image is not "Background Image" and \
the short name of the last image is not "Resize Image" then
delete the last image
end if
unlock screen
PositionPhoto
Does anyone have any experience taking photos and saving them?
I am using LC 6.6.2, 6.7.1, 7.0, 7.0.1 RC 2 with samsung galaxy phone and tablet and Android Kitkat (4.2)
-Will