The error is reported after the Image is Picked.
After some investigation, I came to know that, the the Image is saved in the directory.
(/storage/emulated/0/Android/data/appinventor.ai_rayshubham1321.Timetable/files/.Timetable)
It happens at the if block or at the Convertor(extension to convert from jpg to png).
I'd be just trying to remove the if block and update things about the Error.
Please help if possible.
Thank You for reading this far.
Extra Info : The collapsed blocks don't contain anything, i.e., they are blank.
Actually the thing isn't fairly simple. Also, it appears long because of the variables.
What I'm doing is, first the Activity Starter will pick the image, which takes one block. Next, the file path would be received, which takes another block. Next, the file will be copied from its original destination to the app-specifi directory.
The next block is multipurpose. It will first convert the asd file into png (if not already a png file). It will also set the name of the file to TimeTable.png. It will also maintain the case if the file was originally named as Timetable.png.
The next block opens the WebViewer.
So every task is done in one procedure.
I've now removed the hard-coded package name and changed it to /files/.Timetable/Timetable.png. Waiting for the app to be installed in the background.
I beleive there is an issue with the convertor extension. It does not seem to want to traverse a directory with a . in it, i.e. edu.mit.appinventor.aicompanion3. This will be the case for most package names.
Perhaps @Kumaraswamy could take a look and advise? My guess is the code is looking for the first . when it needs to be looking for the last one (lastIndexOf) I also notice that WEBP is now deprecated, in favour of WEBP_LOSSY and WEBP_LOSSLESS (but this only appears to work on Android < 29).
A rework, using just the File component and an imagepicker (assumes the convertor extn was working!). Copies the html file to the Timetable directory, then no file path required to the image, just the filename.
Why not ? It is doing the same thing as GET_CONTENT, saves a copy of the image to the ASD for you, and in my blocks I delete the created file after conversion. What is not to like ?
The original file, as located by the opening of the gallery by the imagepicker is never touched. A copy is made to ~ASD/Pictures/_app_inventor_image_picker/, and my bocks work with and eventually delete that file.
Deletion is not strictly necessary, the image picker will only store up to 10 files, then start deleting the first one to make way for the next.
My extension carrier ended just as I was writing the class Constructor.
First I'd use this. Then I'll test the app. Then I'll make an extension myself.