PhotoEXIF

Post

Posted
Rating:
#1 (In Topic #337)
Avatar
Guru
cogier is in the usergroup ‘Guru’
I am putting this out there to see if it is of interest and if anybody can find any bugs or just make a comment. The program is designed to display photos, their EXIF data and, if available, a map of the location the picture was taken.

The program includes 'exiftool' which makes it a bit big for the forum so you can find it here. (There are 2 compressed files but they contain the same program.)

<IMG src="http://www.cogier.com/gambas/PhotoEXIF.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
stevedee is in the usergroup ‘Regular’
Just downloaded for a quick look, will spend more time on it tomorrow.

Initial thoughts; it looks great!

I may have font issues as the EXIF data looks bold & larger than necessary. Also the status message is clipped and font looks a bit big.

I don't really understand the Auto/Man switch. I would have thought this should switch itself to Man when I hit one of the 90deg left/right buttons. Maybe a rotated image would be on its side when set to Man?

Not sure whether the 'mode' is of any use.

Would like to be able to set the default folder path (e.g. I might want it to open in {say} /home/steve/photography/2019).

Not sure about the 'close the program button'. I don't think its necessary, but if its needed it should probably be on extreme left or right, rather than in among the other buttons.

Note: I reserve the right to change my mind about any of the above, when I take a second look tomorrow.

<IMG src="%5Battachment=0%5DPhotExif.png%5B/attachment%5D"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
Thanks and thanks again for the input. It is very infrequent that I get any feedback on programs I have written even though I include an email address. My most popular Gambas Farm program BarcodeCreator has had 1364 downloads to date and not a single comment.

Anyway onward…..

 
I may have font issues as the EXIF data looks bold & larger than necessary. Also the status message is clipped and font looks a bit big.
OK I wondered. I will change that after 'will spend more time on it tomorrow.'

I don't really understand the Auto/Man switch.
I think this is a good feature. This will automatically rotate a photo if necessary, or not if on Manual. Seems to work well, see grandchild that wont keep the fancy dress on until I take the picture :cry:
<IMG src="http://www.cogier.com/gambas/esme.png"> </IMG>

Not sure whether the 'mode' is of any use.
You are probably correct. I spent some time working out what 'Mode' was all about and adding my knowledge to the Gambas help files. So added this  'feature' as I understood it but it only shows its use on small pictures. I thinks I will remove it based on your comments.

Would like to be able to set the default folder path (e.g. I might want it to open in {say} /home/steve/photography/2019).
The last folder used on closing the program is saved and will be reopened on restarting the program, or do you have a different wish?

Not sure about the 'close the program button'. I don't think its necessary, but if its needed it should probably be on extreme left or right, rather than in among the other buttons.
Good point, I'll look into that.

Note: I reserve the right to change my mind about any of the above, when I take a second look tomorrow.
Equal to 'What ever happens it nothing to do with me gov!'  :)

I look forward to more constructive criticism and thanks again.
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
cage is in the usergroup ‘Regular’
 I really like this program cogier, it is as good if not better then most of the ones in the repositories.  One feature I would like to see is the ability to delete images in the folders.  Not sure if you have that in the program or not.  I am still playing around with it and will let you know more later.
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
cage is in the usergroup ‘Regular’
I added a button to your program to delete pictures being displayed.  I wanted to use a right click to do it but it caused problems.  Going to work on that.

<IMG src=""> </IMG>

I added a delete button and disabled it, but as soon as the program runs it's enabled.  Here is the routine that I used.  You can use it or make a better solution.

Code (gambas)

  1. Public Sub btnDelete_Click()
  2.  
  3. Select Message.Question("Are you sure you want to delete: " & DirChooser1.SelectedPath &/ FileView1.Current, " Yes ", " No ")
  4.      
  5.       Kill DirChooser1.SelectedPath &/ FileView1.Current
  6.      
  7.     Case 2
  8.       Message.Title = "Delete"
  9.       Message.Info("Deletion has been aborted")
  10.       Return
  11.  
  12.   Message.Title = "Entry Deleted"
  13.   Message.Info(DirChooser1.SelectedPath &/ FileView1.Current & " has been deleted!")
  14.   Form_Open
  15.  

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Regular
cage is in the usergroup ‘Regular’
Okay worked out the problem with right click delete.  Just added this code to the end of the code.

Code (gambas)

  1. Public Sub FileView1_MouseDown()
  2.  
  3.    If Mouse.Button = 2 Then
  4.     Select Message.Question("Are you sure you want to delete: " & DirChooser1.SelectedPath &/ FileView1.Current, " Yes ", " No ")
  5.       Case 1
  6.      
  7.         Kill DirChooser1.SelectedPath &/ FileView1.Current
  8.      
  9.        Case 2
  10.          Message.Title = "Delete"
  11.          Message.Info("Deletion has been aborted")
  12.          Return
  13.  
  14.   Message.Title = "Entry Deleted"
  15.   Message.Info(DirChooser1.SelectedPath &/ FileView1.Current & " has been deleted!")
  16.   Form_Open
  17.  
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cogier said

Thanks and thanks again for the input. It is very infrequent that I get any feedback on programs I have written even though I include an email address. My most popular Gambas Farm program BarcodeCreator has had 1364 downloads to date and not a single comment.

Most people don't provide feedback. Those that do often fall into 2 groups:-
  1. Those that feel very strongly about something (the extremists).
  2. Those that like the sound of their own voice (Err…ok, that's me).

 So you may need to clock up thousands of downloads before you get feedback.
…and of course people may be happy, so have nothing much to say!

At least you haven't been beaten up yet (see my recent rant: Captain Bodgit: Never look a gift horse in the mouth)

I don't really understand the Auto/Man switch.
I think this is a good feature. This will automatically rotate a photo if necessary, or not if on Manual. Seems to work well, see grandchild that wont keep the fancy dress on until I take the picture :cry:
I tend to see ambiguity in a lot of things that others don't (its probably some kind of …ism); with labelled push buttons, I'm never sure whether the text shows the current state or what happens when you press it…that's why I prefer radio buttons or tick boxes.



Would like to be able to set the default folder path (e.g. I might want it to open in {say} /home/steve/photography/2019)…<COLOR color="#BF0000">.Did I say that?</COLOR>


I look forward to more constructive criticism and thanks again.

…I'll be back!
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Regular
stevedee is in the usergroup ‘Regular’
When I run the program I get this message:-
"gb.gui.qt: warning: 'gb.qt5' component not found, using 'gb.qt 4' instead"
…so that may be linked to my font/presentation issue.

You have "Bookmark current directory" and the program stores the last used path, so that's all covered.

I'd like to be able to use the up/down arrow keys to move through the images in a given directory.

For much of the time I'm only interested in a sub-set of EXIF data (e.g. Exposure, F-stop, ISO, focal length) so it would be nice to be able to config this as a user setting.

I don't have any photos with GPS data, but if you'd like to post a few, I'll test that aspect as well.

conclusion

As a simple jpeg viewer, this program works well, has a pretty clean user interface, and your code (as always) looks neat & tidy.

If you are looking for ideas for expansion, I'd say consider adding a histogram and a way to launch an external (user selectable) image editor.

If you really want to up-your-game consider this; an increasing number of people are now taking pictures in a RAW format. However, all RAW files contain a jpeg image version which allows viewers (like Geeqie) to quickly open and display images without consuming GBytes of RAM.

Operating as a RAW viewer may be drifting too far away from your original spec, if so, please ignore.
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Regular
stevedee is in the usergroup ‘Regular’
…and just one more thing, it looks like you can use exiftool to get jpegs from RAWs.

This works:-

Code

exiftool -b -JpgFromRaw \{Nikon raw.NEF} > test.jpg
…for some RAWs like Nikon .NEF files

While this works:-

Code

exiftool -b -PreviewImage \{Olympus raw.ORF} > test.jpg
…for others like Pentax (.pef) and Olympus (.orf)
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Guru
cogier is in the usergroup ‘Guru’
I am working on many of your and cage's comments. Please wait. Regarding RAW images I only have one comment.

Stay tuned…..
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Guru
cogier is in the usergroup ‘Guru’
OK. Updated program and three pictures complete with GPS data (2 in Guernsey, 1 in Berlin) are here.

Mode feature - Removed.
Extra program close button - Gone.
Right click delete file feature - Added.
Auto rotate - Changed to a CheckBox .
Key scrolling feature on FileView - Added.
EXIF '-common' feature - Added.
You can now click the main photo to pop it out and click it again to close.
Font size and bold text - Removed.
Note that most of the internal window components are re-sizeable.
The program uses the excellent 'Task' feature to collect the EXIF data in the background which uses a separate processor core.

I was looking at the Histogram option but it seems that you, SteveDee, have the only example on the web. Unfortunately I can't work out how to use it, help required please.
Regarding RAW images, if you have some do they not display the EXIF data?
The idea of a button to an external photo editor is a sound idea but each distro has different ones. I suppose I could ask the user to point to their favorite editor. - Requires more thought.
The idea of user selecting the type of data displayed is possible but would be quite a task. There is already a search box to fine tune the displayed data. - Requires more thought.

I think that covers it all so far. Thanks SteveDee and Cage for your input. :D
Online now: No Back to the top

Post

Posted
Rating:
#12
Avatar
Regular
cage is in the usergroup ‘Regular’
cogier it's looking great.  Very nice work.  I have a quick launcher program that allows the user to look up a program to place it into an index file.  You could do something similar in a config file in your configs folder.  Look at this code I use and modify it to your liking for your program. Should give you a good place to start.

Code (gambas)

  1. Public Sub Form_Open()
  2.  
  3.    Me.Center
  4.    'TextBox1.SetFocus
  5.  btnSelect.Enabled = False
  6.  
  7.  
  8. Public Sub Form_KeyPress()
  9.    
  10.    If Key.Code = Key.Esc Then
  11.       Me.Close
  12.    Endif
  13.    If ListBox1.Text <> "" And Key.Code = Key.Return Then
  14.      btnSelect_Click
  15.    Endif
  16.    
  17.  
  18. Public Sub ListBox1_DblClick()
  19.  
  20.    'Message("You Selected " & ListBox1.Text)
  21.    Global.CopyCmd = ListBox1.Text
  22.    
  23.  
  24.    Me.Close
  25.  
  26.  
  27. Public Sub btnCancel_Click()
  28.  
  29.    Me.Close
  30.  
  31.  
  32. Public Sub btnSearch_Click()
  33.  
  34.    Dim SearchFor As String
  35.    Dim fileName As String
  36.  
  37.    'ListBox1.Clear
  38.    ' ListBox1.SetFocus
  39.    
  40.    SearchFor = TextBox1.Text
  41.  
  42.    If SearchFor = "" Then
  43.       Message.Title = "Error"
  44.       Message.Error("You Need To Enter Search Data")
  45.       Return
  46.    Endif
  47.  
  48.    For Each fileName In Dir("/usr/bin/", "*", gb.File)
  49.       If InStr(UCase(filename), UCase(SearchFor)) Then
  50.          ListBox1.Add("/usr/bin/" & fileName)
  51.       Endif
  52.  
  53.    Next
  54. btnSelect.Enabled = True
  55.  
  56. Public Sub btnSelect_Click()
  57.  
  58.          If ListBox1.Text = "" Then
  59.       Message.Title = "Error"
  60.       Message.Error("You Need To Click on File First")
  61.       Return
  62.    Endif
  63.       Global.CopyCmd = ListBox1.Text
  64.    
  65.  
  66.    Me.Close
  67.  
  68.  

<IMG src=""> </IMG>

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#13
Avatar
Regular
stevedee is in the usergroup ‘Regular’
I really like these changes Charlie.

I just noticed that I should see "Show" top left. This didn't appear at all in my first screen shot (see earlier post) and now I see "how". I also get a message complaining about my browser (…that may be due to some security setting or NoScript or the wrong browser being selected on my system).

Image

(Click to enlarge)


I was thinking about those little triangle things in the Gambas IDE that we use to collapse/retrieve panels, and wondered if they could be used in this application.

Image

(Click to enlarge)

I think the way they disappear in the IDE is too subtle, but in your app you could use them for the EXIF window but make sure they are visible all the time.

The folder tree view is annoying (as it often is on other apps). Its too narrow when you want to see it, and too wide when you don't.

I added this code:-

Code (gambas)

  1. Public Sub DirChooser1_Enter()
  2.  
  3.   HSplit2.Layout = [100, 0]
  4.  
  5.  
  6. Public Sub DirChooser1_Leave()
  7.  
  8.   HSplit2.Layout = [5, 95]
  9.  
  10.  

Which seems to solve these issues (well…for me, anyway).

This kind of approach may allow you to remove the Show: Folder/EXIF/GPS checkboxes altogether.
Online now: No Back to the top

Post

Posted
Rating:
#14
Avatar
Guru
cogier is in the usergroup ‘Guru’
 Steve did you try the Bing maps? Regarding the 'Show' issue you can resize the  directory and file windows which should solve your problem.

Any advice on Histograms?

Cage, thanks for the code I will look at that later.
Online now: No Back to the top

Post

Posted
Rating:
#15
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cogier said

Steve did you try the Bing maps?
Yes, Bing is OK

Any advice on Histograms?

Take a look at my code here;  Captain Bodgit: Gambas: Improving the PhotoViewer

<COLOR color="#BF0000">EDIT: my comment in the article above about the Red & Blue histograms problem was subsequently fixed after I spoke to Benoit in Oct 2012. I think he just crossed them over.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#16
Avatar
Regular
cage is in the usergroup ‘Regular’
Your welcome cogier.  You helped me so I am glad to help you when ever I can. :D
Online now: No Back to the top

Post

Posted
Rating:
#17
Avatar
Guru
cogier is in the usergroup ‘Guru’
Updated program is here.

Histogram - Added. Matt and I spent yesterday afternoon working it all out, thanks Steve for your work on this, it guided us in the right direction. I have taken the basics and will put it on the Farm as an example.
Picture edit feature - Added. Please look at the EdList file and let me know if there are any other photo editors I have missed. The list is used to see what you might already have on your computer.

The problem with the buttons being 'squashed' has been addressed. I have moved them and if the window area is too small they will drop down onto a new line.

Cage just a small point regarding your code.

Code (gambas)

  1. If Key.Code = Key.Esc Then
  2.       Me.Close
  3.    Endif

This can be simplified to.

Code (gambas)

  1. If Key.Code = Key.Esc Then Me.Close

As before please let me have your comments.

<IMG src="https://www.cogier.com/gambas/PhotoEXIF1.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#18
Avatar
Regular
cage is in the usergroup ‘Regular’
 Cogier as always your suggestions very much welcome.  My biggest problem is that I am an old school programmer. I do appreciate your suggestions and end up using them, thank you.  As for your program it's really coming together really nicely.  As it stands right now I would put it the top 3 programs that are available.  It is now going to be used on my system.  I do have one question though.  Can you explain exactly how the settings command works.  I have search for an answer but what I have found were very vague.  I managed to make it work but it's not putting the file where would like it.  If you could help out with that I would really be grateful.
Online now: No Back to the top

Post

Posted
Rating:
#19
Avatar
Regular
stevedee is in the usergroup ‘Regular’
Just checked the latest version, and its looking really good. :D

I'm only left with 2 or 3 very minor points.

Although most people will only have picture files in their picture folders, I often end up with pictures in a mixed file folder (e.g. the Desktop, Downloads & so on). So I suggest you set up the FileView Filter, e.g.

Code (gambas)

  1. FileView1.Filter = ["*.bmp", "*.gif", "*.jpg", "*.png", "*.tif"]

I'd also suggest moving the Help icon to join the others. This would allow the FileChooser & FileView to fill the gap 'floor to ceiling'.

Also, I'd swap the edit icon for the 'brush & palette' icon (I think its just called "color").



P.S. I never use the one line IF…Then…   as I think the If…EndIf block stands out better in the code and its easier to enter a breakpoint if needed.
And anyway, the block auto completes after typing Then<enter>
…Or if<tab>    when "Code Snippets" are enabled.
Online now: No Back to the top

Post

Posted
Rating:
#20
Avatar
Guru
cogier is in the usergroup ‘Guru’
Although most people will only have picture files in their picture folders, I often end up with pictures in a mixed file folder (e.g. the Desktop, Downloads & so on). So I suggest you set up the FileView Filter, e.g. FileView1.Filter = ["*.bmp", "*.gif", "*.jpg", "*.png", "*.tif"]

I thought about this and maybe I could add it as an option. The reason I did not do this is because many other files can have a wealth of EXIF information. Have a look at mp4 files for example.

I'd also suggest moving the Help icon to join the others. This would allow the FileChooser & FileView to fill the gap 'floor to ceiling'.

Good point! I have already posted this on the Farm so I might wait a while before I update this. (UPDATE. I have updated this on the Farm as I found a small bug and there had only been one download.)

Also, I'd swap the edit icon for the 'brush & palette' icon (I think its just called "color").

I had a look but could not work out to which one you are referring. 'Color' on my system looks like this <IMG src="http://www.cogier.com/gambas/color.png"> </IMG>. 'Edit' seemed appropriate but it's all subjective…  :!:

..Or if<tab> when "Code Snippets" are enabled.

I didn't know that one. You learn something every day. :D
Online now: No Back to the top

Post

Posted
Rating:
#21
Avatar
Regular
stevedee is in the usergroup ‘Regular’

cogier said


Also, I'd swap the edit icon for the 'brush & palette' icon (I think its just called "color").

I had a look but could not work out to which one you are referring. 'Color' on my system looks like this <IMG src="http://www.cogier.com/gambas/color.png"> </IMG>. 'Edit' seemed appropriate but it's all subjective…  :!:

My "color" icon looks like this;

Image

(Click to enlarge)


I don't fully understand how Gambas Stock icons work.

I know the Stock class (gb.form) returns system icons, so these icons must be Theme dependant. However, on my system the "color" icon is actually /usr/share/icons/gnome/24x24/categories/applications-graphics.png

Image

(Click to enlarge)


..Or if<tab> when "Code Snippets" are enabled.

I didn't know that one. You learn something every day. :D

I'm not a big user of Code Snippets (…but then I'm not a big user of Gambas) but I use some for declarations like; db<tab>

Code (gambas)

…if I remember.
Online now: No Back to the top

Post

Posted
Rating:
#22
Avatar
Administrator
sholzy is in the usergroup ‘unknown’
I downloaded and installed the latest from the farm. Running the installed gave an exception message. So I uninstalled.
Image

(Click to enlarge)


When I run it from the IDE, the button images are not showing.
Image

(Click to enlarge)


I just wanted to take a quick look at the app, but I don't have time right now to dig into the above issues as it's late and I need to get up early, but I wanted to post this info while I had the chance. Maybe this weekend I'll be able to have some Gambas play time.

System: Debian 10, KDE 5
Application colors: Breeze Dark
Desktop theme: Crown Blue
Icon theme: Oxygen

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#23
Avatar
Guru
cogier is in the usergroup ‘Guru’
Thanks again for all the input.

SteveDee
The problem of 'Your browser needs to be updated…' is due to you not having QT5 installed. I used Synaptic and installed: -
gambas3-gb-qt5
gambas3-gb-qt5-ext
gambas3-gb-qt5-opengl
gambas3-gb-qt5-webkit

Once that's done you will, hopefully, find it works OK.

I have noticed that the icons change depending on which distro you're running so I presume that Gambas uses the distro's theme icons.
Regarding the 'Snippets' the one I use the most is 'ps<Tab>' which gives you: -

Code (gambas)

  1. Public Sub Name(Arguments)
  2.  

Got2BeFree
I have tried various distros and I think the Gambas 'Download and install' feature is broken. The problem of the missing folder is the 'exiftool' folder that comes with the program!
The missing buttons: -
I installed Debian 10 KDE 5 and then started changing the settings 'Application colors: Breeze Dark' all OK, 'Desktop theme: Crown Blue' still OK, 'Icon theme: Oxygen' - Buttons gone!!
It seems that Gambas can't cope with that combination.

Cage
I hope you like my version of finding suitable photo editing software, you pointed me in the right direction, thanks.

Others
Don't close the program on an empty directory as this will generate an error when restarting the program and you will need to delete the 'conf' file to continue. I will update soon. (Now updated on the Farm)
Still looking for feedback on the names of picture editing software I might have missed, see the 'EdList' file in the program. Is your favorite one listed?
Online now: No Back to the top

Post

Posted
Rating:
#24
Avatar
Administrator
sholzy is in the usergroup ‘unknown’

cogier said

Got2BeFree
I have tried various distros and I think the Gambas 'Download and install' feature is broken. The problem of the missing folder is the 'exiftool' folder that comes with the program!

Created an install package (.deb) and still have the same error when starting the app.

cogier said

The missing buttons: -
I installed Debian 10 KDE 5 and then started changing the settings 'Application colors: Breeze Dark' all OK, 'Desktop theme: Crown Blue' still OK, 'Icon theme: Oxygen' - Buttons gone!!
It seems that Gambas can't cope with that combination.

The buttons are still there and the icons are still there. Black icons don't show up on dark themes.  :lol:

(On a side note, I've noticed the Gambas IDE doesn't honor icon choice setting in the preferences.)

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#25
Avatar
Regular
cage is in the usergroup ‘Regular’
 I ran into the same problem as Got2BeFree.  Found the answer though.  I just copied the whole folder to my launcher programs directory and it worked fine.  I Guess there are some things in that folder that are needed in order to operate. I figured that if it worked in the Gambas IDE that it would work by copying the complete folder.
Online now: No Back to the top
1 guest and 0 members have just viewed this.