[Gambas-user] Beta testing - Photo organizer.

T Lee Davidson t.lee.davidson at gmail.com
Sat Oct 29 20:59:25 CEST 2022


On 10/21/22 06:04, Martin wrote:
> Hello friends.
> I made a program to rename and move photos that are in a temporary download directory. I use the libexif library with Extern to 
> read the metadata (writing metadata is not contemplated at the moment).
> I try to make it very simple and less complex than programs like Rapid photo downloader.
> There is a readme.md and readme.pdf in English that (I think) explains how to use it.
> Please if someone can test if it works well on your system and make a review of the program it would be good for me to upload 
> something more mature to the farm.
> I'm especially interested in knowing if it works well on systems like Debian, Ubuntu, Mint or OpenSuse, since I only tested it 
> on Manjaro.
> 
> There is no need to create an installation package, it runs from the IDE.
> 
> Important notice: Please make a copy of the pictures before working with them as this is an alpha version and may fail.
> 
> https://gitlab.com/belmotek/photo-organizer
> 
> Martin

I tried running your project on openSUSE Leap 15.3. It fails to operate correctly on two counts.

1) It does not correctly identify the distro, and
2) It does it find that libexif is installed even though it is.

The reason it does not identify the distro is because you are relying on /ect/issue which on my system is just skeleton text:
Welcome to \S - Kernel \r (\l).

eth0: \4{eth0} \6{eth0}


I changed lines 86-95 of System.Distro to thus:
   Shell "cat /etc/[A-Za-z]*[_-][rv]e[lr]*" To strDistro
   hRegExp = New RegExp(strDistro, "ID=\"(.*?)-.*\"\n")
   strDistro = hRegExp[0].Text ' The next four lines are needed as a workaround of a bug in RegExp for SubMatches.
   strDistro = Split(strDistro, "=")[1]
   strDistro = Trim(strDistro)
   strDistro = String.Mid(strDistro, 2, -1)
   strDistro = Split(strDistro, "-")[0]
   strDistro = String.LCase(strDistro)

That works. See https://www.binarytides.com/linux-command-to-check-distro/; "Portable Command" section

(BTW, what does line 90 do?)


The reason is does not find libexif, aside from not correctly identifying the distro, is two-fold.

1. The name of the package on openSUSE is "libexif12", and
2. You have not provided a case for opensuse (or any rpm-based distro) in the Select statement of System.PkgStat.

I added a Default case to the select that may work for multiple rpm-based distros no matter what the package name actually is:
   Case Else ' openSUSE, Fedora, CentOs, etc.
     strCommand = Subst("rpm -q $(rpm -q --whatprovides &1)", strPkg)
     Shell strCommand & " 2>&1" To strPkgStatus
     If String.InStr(strPkgStatus, "not installed") Then
       bolPkgStatus = False
     Else
       bolPkgStatus = True
     Endif


The application now launches with no errors. But, I am unable to test it any further because selecting "Computer" from the 
drop-down does not show devices and Dialog.SelectDirectory does not allow for entering a location manually. I would need to 
enter a location using Media Transfer Protocol (MTP).


Odds and ends:
The Tooltip for the Settings button (gear icon) is "Help".
Developer should be spelled with one 'p'. :-P


-- 
Lee



More information about the User mailing list