Skip to content

Latest commit

 

History

History
620 lines (374 loc) · 28.4 KB

File metadata and controls

620 lines (374 loc) · 28.4 KB

Developer Notes for ImagePicker project

Initial Plan

The image below is a scan of the notepad page with the initial plan for the application.

Scanned notepad page with initial plan for the ImagePicker application

It did not turn out exactly as envisioned. A software project always evolves as you build it, especially when it gets to the point where you can start using it.

Notes

IDE Macros

In project options, what are settings like $(ProjOutDir)?

Doc: IDE Macros in paths and filenames

Unit not found error

Error when clicking on an Event in the Object Inspector (wanting to add an OnCreate event handler):

"Error: unit not found ExtCtrls"

Fixed:

Tools / Options / Files / FPC source directory:

Changed from /usr/share/fpcsrc/$(FPCVER) to /usr/share/fpcsrc/3.2.2

The 'unit not found' error went away. Changed back to the original setting. The error did not come back. Hmmm...

GLIBC version issue

When attempting to run the compiled Linux executable on an older version of Ubuntu (18.04) the application failed to start. It showed the following error message:

./ImagePicker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./ImagePicker)

Use ldd to see the version of GLIBC.

$ ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27

What is the version on the machine where the project is being built?

$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35

Lazarus forum:

Stack Overflow: glibc - Is there anyway to include libc.so in a Lazarus/Free pascal compiled binary? (the answer was no)

Your best bet is to build on the oldest OS you plan to support...

Built the ImagePicker project on Xubuntu 18.04 and the compiled executable also worked on newer Ubuntu versions.


Links and Commits

Lazarus Homepage

Lazarus gitignore

  • Initial commit. New project. Commit a4d571f (2023-03-07 06:57:34)

Docs: TMainMenu, TPanel, TStatusBar

  • Add initial components. Commit 3bf104d (2023-03-08 07:15:18)

Docs: TSplitter

  • Set properties. Add toggle button. Commit 9039e1d (2023-03-08 07:31:58)

Are there open source icons available to use for buttons?

Docs: TImage

How to scale image in TImage component? Properties:

    Center := True;
    Proportional := True;
    Stretch := True;

Docs: Howto Use TOpenDialog

  • Add images for button. Commit e5d4bf3 (2023-03-08 09:35:44)

  • Add image component, and file dialogs. Commit def69e4 (2023-03-08 15:25:55)

  • Add more images for buttons. Commit fe158cb (2023-03-08 15:45:18)

  • Add buttons and glyphs. Commit ad932e6 (2023-03-08 16:27:09)


Docs: TStringList, TStringList-TStrings Tutorial

  • Units for image viewing functions. Commit 009f815 (2023-03-08 16:51:07)

Docs: TTimer

  • Implement slideshow using default dir. Commit c7b6cc6 (2023-03-08 17:59:26)

  • Change button layout. Commit 3a51089 (2023-03-08 18:06:34)


Docs: key down, LCL Key Handling, virtual keyboard strokes/de

  • Add keyboard commands. Commit 81e8398 (2023-03-08 19:31:40)

Docs: TListBox

  • Add list of selected images. Commit 57933e5 (2023-03-08 21:37:27)

  • Implement File/Open. Commit 1a3568d (2023-03-09 07:29:29)

  • Clear Panel1.Caption when image loaded. Commit cdf464c (2023-03-09 08:11:08)

  • Include arrow keys for navigation. Commit 0bc415a (2023-03-09 08:16:54)

  • Delete from selected images list. Commit 51c2af2 (2023-03-09 08:24:36)


Had trouble figuring out how to get command-line args.

Docs: Command line parameters and environment variables

In the IDE, used Run / Run Parameters / Command line parameters to pass the path to the Pictures dir.

Docs: IDE Window: Run parameters

Using ParamCount and ParamStr does not work in a Lazarus application. It seems the Application object gets the parameters and then (maybe) clears them from the original ParamStr.

Docs: TCustomApplication

The parameters are available via GetNonOptions. I messed up at first, thinking the first parameter was still the name of the executable (like ParamStr(0)). That is not the case. The first item in the list is the first parameter.

Docs: TCustomApplication.GetNonOptions

  • Take command-line argument. Commit ea18552 (2023-03-09 10:01:14)

Save the list of picked images to a text file. The format of the text file includes the list of the full path to each image file, and a section with mv commands to rename the files based on Title and Tag. At this point, the idea is to provide commands that can be copied into a separate script for whatever task is to be done with the current set of image files.

  • Implement File/Save. Commit 0ced44b (2023-03-09 14:03:44)

  • Enter Tag for selected images. Commit 412ba2a (2023-03-09 14:59:45)

  • Arrow keys navigation conditional. Commit abdf356 (2023-03-09 16:49:21)

  • Improve arrow key handling. Commit fe9e732 (2023-03-09 17:22:53)

  • Add title to output file name. Commit 1ab770f (2023-03-09 18:05:32)

  • Add hints re hotkeys to buttons. Commit d42c405 (2023-03-09 19:49:07)

  • Add title and tags section to output. Commit 4afb6da (2023-03-10 07:38:38)


  • Show image for selected item in list. Commit a737c07 (2023-03-10 08:37:23)

Confirm remove from list with Yes/No MessageDlg.

Docs: Dialog Examples

  • Change Delete to Remove. No dups in lists. Commit c98e3d1 (2023-03-10 09:38:40)

  • Also show tag in status bar. Commit 3e4406d (2023-03-10 09:53:51)

  • Anchor buttons below list box. Commit 146d6ad (2023-03-10 10:33:30)


Add a TrackBar for navigation in large sets of images.

Docs: TTrackBar

  • Add TrackBar for browsing images. Commit 47517b5 (2023-03-10 14:40:33)

Any settings that can improve image quality? Turning on anti-aliasing did help.

  • Set AntialiasingMode = amOn. Commit 5e56e97 (2023-03-10 14:51:24)

No need for Splitter. Toggling Panel2 in and out is good enough.

  • Change panel layout to fix toggle. Commit 7c6be41 (2023-03-10 17:14:33)

Docs: Copy2SymbDel, TrimSet, TStrings.Values

  • Load from previous output file (initial). Commit 15cdfcf (2023-03-10 18:49:06)

  • Load from previous output file. Commit 0173b7c (2023-03-11 07:47:14)

  • Create initial README.md and devnotes.md. Commit 226a02b (2023-03-11 09:12:14)

  • Refactor load from file so TrackBar is updated. Commit 3f98043 (2023-03-11 10:12:59)

  • Add rename-all section to output. Commit 8762560 (2023-03-11 14:57:13)


Docs (Multiplatform Programming Guide): Configuration files, Data and Resource files

  • Add Tools/Options menu (initial). Commit a0178d3 (2023-03-12 15:57:17)

  • Update APP_VERSION. Commit d5c51cf (2023-03-12 17:13:33)

  • Add uapp.pas for const such as APP_VERSION. Commit 057a4fb (2023-03-13 11:05:20)


Docs: TListBox, TStrings.Exchange

  • Add buttons to show and move ListBox items. Commit dbf83a6 (2023-03-13 12:05:46)

  • Handle show and move ListBox items. Commit 4532cd6 (2023-03-13 14:47:12)

  • Sort on File/Open. Check first line on File/Load. Commit 3c58dbe (2023-03-13 18:17:34)


  • Work on arrow key behavior. Commit fb56d94 (2023-03-14 10:01:10)

Without the speed control, Panel3 can be more narrow. Put the buttons in one column.

  • Move speed control. Nav buttons in one column. Commit fc3b85c (2023-03-15 21:14:08)

  • Update tab order. Commit 5d6c0ea (2023-03-15 21:17:48)

  • Click on image to show full path in status bar. Commit e6a6deb (2023-03-15 21:26:28)


  • Use last image to LoadImagesList in LoadFromSavedFile Commit 8f9b99b (2023-03-15 21:33:27)

  • Spacebar play/stop when not in edit control Commit 1a98c48 (2023-03-15 21:47:30)

  • Swap F6 and F7 show selected images functions Commit 427dbdf (2023-03-15 22:09:00)


Docs: GetAppConfigDir

  • Add TAppOptions class. Commit 095f1b7 (2023-03-17 19:16:30)

  • Implement LastOpenDir and LastSaveDir for TAppOptions. Commit 83a1905 (2023-03-17 20:30:43)


Add methods to actually copy the selected files in the ListBox.

Docs: TSelectDirectoryDialog, TSelectDirectoryDialog, CopyFile

  • New form saved as uCopyFilesDlg. Commit cca565f (2023-03-18 07:34:49)

  • Add new form files. Commit 4517c9a (2023-03-18 08:06:24)

  • CopyFilesDlg initial components and properties Commit d9d5e32 (2023-03-18 08:35:16)

  • CopyFilesDlg browse for folder Commit aba8255 (2023-03-18 09:16:11)

  • Add method CopyFilesInList Commit 289ddc4 (2023-03-18 11:10:03)

  • Confirm overwrite in CopyFilesInList Commit a151ecb (2023-03-18 13:28:50)

  • Add LastCopyDir to AppOptions Commit 08a1fb5 (2023-03-18 14:30:56)


  • Specify directory separately in Save dialog. Commit d78dc55 (2023-03-18 16:39:35)

Use OpenDocument from the LCLIntf unit to open the options file using the default associated application for text files.

Docs: Executing External Programs, OpenDocument

  • Open options file using associated app for text files Commit e875273 (2023-03-19 20:56:34)

  • Rename options file Commit dbf8908 (2023-03-19 21:44:19)


Tools/Options OpenDocument not working on Windows.

Docs: MkDir, CreateDir, ForceDirectories

  • Use ForceDirectories. Tools-Options opens folder Commit cc1b95d (2023-03-20 09:09:48)

  • Add checkbox to control looping. Commit e9e6284 (2023-03-24 11:30:42)

  • Update tab order. Commit 5025521 (2023-03-24 11:33:11)

  • Store DoLoop and SpeedMs in AppOptions. Commit f1d3c89 (2023-03-24 12:01:39)


  • Replaced default icon. Commit bfeb31b (2023-03-25 07:25:09)

  • Add note re TTrackBar handling. Commit 84ccbc9 (2023-03-25 08:53:23)

  • Add Windows executable name to .gitignore Commit 1f079ca (2023-03-25 08:58:23)


Option to recurse sub-folders on open image location.

Docs: Enum Type

  • Prompt to scan sub-folders for image files Commit 939dd49 (2023-03-31 19:15:43)

Separate menu item for Open Folder vs Open File.

  • Add 'Open Folder' menu item and OpenDirDialog. Commit f04d2d9 (2023-04-01 09:00:38)

  • New custom icon Commit e212831 (2023-04-12 14:24:19)

  • Update app icon Commit 617242c (2023-05-19 08:08:56)

  • Revised app icon Commit 50dd2fa (2023-05-19 22:04:36)

  • Update app icon Commit 5d7ce1a (2023-06-04 09:40:10)


Docs: Clipboard

  • Copy file paths to clipboard Commit a247cd5 (2023-06-04 12:24:19)

  • Refactor rename ListBox1 to Picks Commit ff8d4c9 (2023-06-05 14:17:53)

  • Fix anchoring of Copy button Commit 47b3a32 (2023-06-05 14:42:23)

  • Ask to clear picks when opening file or dir Commit dd4fd3e (2023-06-05 19:46:17)

  • Remove some commented-out code Commit c622339 (2023-06-06 08:30:48)


  • Refactor rename ImageList1 to Glyphs Commit 9648bf7 (2023-06-09 08:51:06)

  • Move save and load picks to new unit Commit cf9b699 (2023-06-09 15:15:08)


  • Handle showing picks where multiple source dirs Commit c7effef (2023-06-11 11:02:19)

  • Edit message text in AskToClearPicks Commit 86f66d8 (2023-06-11 11:12:17)


  • Named const for ImageIndex changed by code Commit 44109db (2023-07-02 15:26:25)

Refactoring

  • Refactor rename Form1 to MainForm Commit 9583134 (2023-07-12 08:24:03)

  • Refactor rename buttons Commit 4849523 (2023-07-13 08:03:23)

  • Refactor rename menu objects Commit e6f3aa6 (2023-07-14 07:28:16)

  • Refactor rename more buttons Commit 3dab4b7 (2023-07-14 07:35:54)

  • Refactor rename panels Commit f5e4a65 (2023-07-14 07:44:47)

  • Refactor rename single objects Commit caafc0f (2023-07-16 13:40:10)

  • Refactor sort MainForm class declaration Commit 973c850 (2023-07-16 14:23:46)

  • Refactor sort MainForm implementation Commit 3a0efac (2023-07-16 14:31:13)


  • Handle missing files on loading saved list Commit 046d31a (2023-10-05 16:49:23)

  • Add LastLoadDir to AppOptions Commit 6fdf6ee (2023-10-06 10:40:36)

  • Fix using wrong source for LastOpenDir Commit 6dece3a (2023-10-06 10:57:36)


  • Select item after Remove item from Picks Commit c91d31e (2023-10-23 10:46:34)

  • Open folder containing current image Commit 639fa57 (2023-10-30 11:03:24)

Docs: TRadioGroup

  • Add file naming options to CopyFilesInList Commit 4be6b3a (2023-10-30 15:01:54)

  • Add 'Sort picks' to Tools menu. Expand devnotes.md Commit b980a0e (2023-11-14 14:06:35)

Docs: Calendar Versioning

  • Use calver. Update editTag on show image in list Commit ab69ec8 (2023-11-26 15:09:53)

Docs: OpenURL

  • Add About dialog Commit b9f90a8 (2023-11-29 16:11:06)

  • Add to About dialog Commit 4947ac1 (2023-11-29 17:09:36)

  • Add LICENSE Commit 9c2042c (2023-11-29 19:49:22)


Docs: Application manifests - Win32 apps

  • Update project name in manifest Commit 0fd760b (2023-12-01 20:39:17)

While using ImagePicker to collect and tag a series of screenshots, it seemed that the process could be improved if there was a separate mode for working only with the list of images already picked.

A picks-mode would:

  • Disable navigation within the source images folder.
  • Reassign some navigation functions to work within the picks list instead of the source images.

This would make it easier to focus on the picks list for selecting, tagging, reordering, and removing items.

  • Add picks-mode button and initial code Commit d5fb072 (2023-12-12 18:16:48)

  • Implement picks-mode Commit b1f04c5 (2023-12-12 21:43:24)

  • Change editTag caption to assign Alt+G Commit 52bbee6 (2023-12-16 15:09:52)


Additional changes after using picks-mode.

  • Cancel picks-mode on file-open or load-list Commit 09c0924 (2023-12-18 18:49:43)

  • Enable Home and End keys in picks-mode Commit efeedd0 (2023-12-20 17:59:59)


  • Move About to new Help menu Commit dc3096c (2023-12-20 18:26:05)