Are you able to make it possible through an update from the extension? That would be really helpful.
Why not use this extension
It would be more reliable and easy to use if I used a block like this:
But I don't know how I would program it. I have my app use PDF extension and I want my PDF to jpg to be done through a single block rather than a visible component.
It would allow the PDF to be converted into a jpg in the background. No visible components.
I would need to write a different extension.
Ok, Thank you!
Try it:
Use view-pdf extension to preview/identify pages in pdf
Use ImageConvertor or ImageCropper extension if image requires further cropping.
Hi all.
Can the ImageConvertor1.Convert and ImageConvertor1.resize be able to output the result into a custom location like: /storage/emulated/0/Download/ ?
thanks.
Yes, read the first post, it shows you that you need to provide an absolute path for your files.
Depending on your Android version, you may have to allow media permissions to do this.
I usually perform image convertor operations on image files in the ASD, then copy them to Shared Storage as required using the File component.
.
.
.
As an aside, I moved your post into this topic, why did you not ask here directly ?
Hi @TIMAI2.
I'm trying to use your Convertor extension to resize images.
I select an image with picker and I would like to view the resized image in an image component.
I ask for permission to read and write external in initialize block.
Unfortunately I receive this message
"no protocol: /storage/emulated/0/Pictures/_app_inventor_image_picker/picked_image4428068802340960174.jpg"
What can I do?
Hmm, this shouldn't be happening, but you can fix it like so:
Please show the values for ImagePicker1.Selection
and "your" Image1.Picture
Confirm that the image.Picture value is the same as the imagepicker.Selection.
How are you testing, companion app or compiled app ?
What android version and filescope (set in Designer)?
@TIMAI2
Testing in companion
DefaultFileScope: App
Android version 8.0.0
In this way my app works
My questions:
1 - without "Ask for permission" my app works...will this appen when I will deploy it as APK?
2 - will my blocks work when I will deploy it as APK? (I refer to path, dependence on Android version >10, <10, permission, etc...) Do you think I have to integrate some blocks in order to recognize Android version and work in different way?
3 - is it right the procedure to always use "image picker - selection" in all my blocks?
4 - my original picture in the gallery of my phone is unchanged (it is ok for me). My curiosity : does image picker create a copy and my app makes resizing in that?
I'll come back to questions 1 & 2, requires some revision/research on my part...and I will have to dig out an old device that uses the shared storage file path.
We should now understand how the ImagePicker works. When you make an image selection from the "gallery" with ImagePicker, it makes a copy of the file to shared storage (earlier android versions) or to the ASD (later android versions), and gives it a different file name. You can store up to 10 images in this way, try to store an 11th, and the 1st image will be removed. If you want to work on the imagePicker image, any modifications will be made to that copy, not the original.
An alternative to this, and to overcome the 10 image limit, or to work directly with the picked file, you can use the activityStarter. This is covered many times on the community, but I can show you how.
-
Yes, this provides a valid absolute path to the copied file. You may wish to store the value/filepath to a variable though, and use that instead.
-
As you can see from the above, yes, the imagePicker makes a copy, and your blocks are working on that copy, not the original image, which will remain untouched.
Much may depend on what you intend to do with the modified image file...
To keep this chugging along as I test.
On Android 7 ( early android version) you need to ask for WriteExternalStorage permission for the compiled apk:
The user will get a one time notification to set this. They need to say yes.
Now if memory serves me correctly, from Android 10 you still need WRITEEXTERNALSTORAGE permission, because the imagepicker is still working in shared storage. But from Android 13 onwards, imagepicker uses the ASD, so no write permission should be needed, however you will probably need READ_MEDIA_IMAGES permission to get images from shared storage.
( I am sure I will be corrected if I have this wrong )
Glad you started ?
Me, I generally do not bother with any of this, and either work with files in the ASD or use the SAF extensions to give me read / write access to files in shared storage without having to worry about permissions.
Thank you @TIMAI2 for this introduction to the theme of file storage... This is school for me!
What can I do to make my app ready to work with all Android configuration?
If your answer will be ASD, could you kindly share info (or blocks) relating to how correctly use ASD in MIT App Inventor? I have not well understood what ASD is.
and also with the files in shared storage.
What is your aim for users to be doing in your app?
If we understand this then we can move forward from there.