Android Question SMM FileMaxSize and PreprocessExif

gunnarjonsson

Member
Licensed User
Longtime User
Hi All!
I am trying to show all my camera photos in SMM with MediaManager.SetMediaFromFile(..
This works as expected. However I notice that photos larger than around 8.4 mb result in error FileMaxSize error and subsequently are grayed out. How Is it possible to increase this limit or can you reduce its size temporarily without creating duplicates?
I also wonder how the PreprocessExif function can be used with MediaManager.SetMediaFromFile(.. since many of my photos are shown with the wrong orientation.

Gunnar
 

MarcoRome

Expert
Licensed User
Longtime User
 
Upvote 0

gunnarjonsson

Member
Licensed User
Longtime User
Thanks for this.
I tried it like this:
MediaManager.SetMediaFromFile(pnl.GetView(x).GetView(0), pathdata.Dir, pathdata.FileName,"imag
e/png",CreateMap(MediaManager.REQUEST_RESIZE_MODE : "FILL_NO_DISTORTIONS"))

This results in only filesizes greater than 10 mb being excluded.

The orientation still is very random. I was under the impression that smm had the functionality to show photos with their original orientation.

Gunnar
 
Upvote 0

gunnarjonsson

Member
Licensed User
Longtime User
Hi!
This is my log:
Logger connected to: Xiaomi M2007J20CG
--------- beginning of main
** Activity (main) Pause event (activity is not paused). **
*** mainpage: B4XPage_Disappear [mainpage]
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
*** mainpage: B4XPage_Appear
** Activity (main) Resume **
*** mainpage: B4XPage_PermissionResult [mainpage]
*** mainpage: B4XPage_PermissionResult [mainpage]
FindPhotoFoldersIn
Find
FindPhotoFoldersOut
File larger than MaxFileSize 10,077,259
File larger than MaxFileSize 10,234,071

For some reason the SMM library has version 1.13 and the official version is reported as 1.12.

I am also interested in ideas how to solve the photos orientation problem.

Gunnar
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is indeed a limit of 8mb for downloaded files. It is currently not configurable. You will need to modify the source code that is inside the b4xlib(=zip) file. It is in line 43 of SimpleMediaManager.bas.
The reason for this limit is to provide some protection from running out of memory while trying to load very large files.

About the orientation:
1. Make sure to set the mime to: "image/jpeg"
2. Enable logs by adding SMM_DEBUG to the build configuration.
 
Upvote 0

gunnarjonsson

Member
Licensed User
Longtime User
Thanks for the information. Now the orientatin works OK. When I tried to modify the lib to increase the ma filesize it was however not accepted when I tried to compile with the updated version. Perhaps it is not as easy as to just rezip the files to make a new lib.
 
Upvote 0
Top