Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Lab - Command-line image processing


Sample images

  1. One of my directories is the following:
    /users/tutors/mhumphrysdculab/share/testsuite/ORahilly/06.Ballylongford
    
  2. This directory contains images, some very large.


Script

Make a Shell script that does the following.
  1. Go to 06.Ballylongford
  2. Get the file wildcard right: Consider only the JPEG images whose filenames contain the string 008

    
    -rwxr-xr-x 1 mhumphrysdculab tutors 1458188 Sep 17 15:03 sa400008.jpg
    -rwxr-xr-x 1 mhumphrysdculab tutors 335705 Sep 17 15:03 SA400008.lores.jpg
    -rwxr-xr-x 1 mhumphrysdculab tutors 839955 Sep 17 15:03 sa400081.jpg
    -rwxr-xr-x 1 mhumphrysdculab tutors 123202 Sep 17 15:03 SA400081.lores.jpg
    -rwxr-xr-x 1 mhumphrysdculab tutors 640661 Sep 17 15:03 sa400082.jpg
    -rwxr-xr-x 1 mhumphrysdculab tutors 1237799 Sep 17 15:03 sa400083.jpg
    -rwxr-xr-x 1 mhumphrysdculab tutors 222040 Sep 17 15:03 SA400083.lores.jpg
    
    

  3. Your script will build 1/8 size versions of these JPEG images.
  4. Your script will output the new, small images into a directory in your own filespace.

Notes

  1. You will base this on the sample script in Command-line image processing.

  2. Get the input directory and output directory right: You are not to copy my files to your directory and process them there.
    You should leave them in my directory, but send the output to your directory.




Marking

  

100%

Your script makes 1/8 size copies, using the correct input directory and output directory and file wildcard.
  

40%

Your script makes 1/8 size copies of some images somewhere, but not using the correct input directory and output directory and file wildcard.
  

0%

Otherwise.



Questioning

The tutors and I may question you about your code.
If you cannot explain what your code is doing you will lose marks.