i have a bunch of images in a folder (used to lighten-up lecture slides). currently, i change the images included by hand when updating the lecture slides. this requires to change either the width or the height of the image to match, say,
\textheight. i'm wondering if there's an automatic way that would use the aspect ratio of an image to automatically decide if width or height should be manipulated.
i am also considering using a pseudo-random selection of images from that folder, which means that it will not matter if the aspect-ratio-based width-or-height decision is made on the fly or when pre-computing the list of images (with potentially additional information per image).
(hope this two part problem doesn't go against forum rules :)