imreadlastchanged

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Images
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-09, Last change: 2025-09-14

reads in the last modified image of a directory

Description

function useful to read in snapshot save on the desktop directory

See Also: lasttouchedSG , imreadui

Example Illustration

 missing image of imreadlastchanged(iext,idir)

Syntax

[im,fullnam]=imreadlastchanged([iext,idir])

Input Parameter

iext: image extensionsl default is {'*.png' '*.jpg' '*.tif'}
idir: image directory; default is desktopdir

Output Parameter

im: image read in by image read
fullnam: full filename

Examples


imreadlastchanged




Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, imreadlastchanged, reads the last modified image from a specified directory. It is part of the SolidGeometry library and was introduced in version 4.5.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the image extensions and directory from the input parameters or use the defaults.
  2. Store the current working directory in wdir.
  3. Change the current directory to idir.
  4. Call lasttouchedSG to find the last modified image file matching the extensions in iext.
  5. Return to the original working directory stored in wdir.
  6. Construct the full filename using idir and the result from lasttouchedSG.
  7. Read the image using imread and store it in im.
  8. If no output arguments are specified, display the image using imshow and set the title to the filename.
Algorithm explaination created using ChatGPT on 2025-08-19 01:07. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21