Starting from:

$25

CSC368-Project 1 Solved

CSC 368 Systems Programming Languages

Project 1: Batch file

For this assignment you will write (and test) a utility batch file to resize all the images in a directory to 640 pixels wide (web size), placing the resized images into a sub-directory called “web-img” (the original pictures will be unchanged0.
 

You may use the convert executable provided in the zip file on Blackboard to perform the resizing, if you are using a 64-bit machine (such as the VMs).  The file should be extracted to the directory where you will have your batch file or to C:\Windows/System32: As an alternative you can download and install ImageMagick-7.0.4-4-Q16-x64-dll, make sure you select “Install legacy utilities (e.g., convert)” during the installation.  The zip file also contains several pictures you can use for your testing.
 

Your batch file should meet the following criteria:

1.       Name your batch file websize.bat

2.       Your batch file should take the name of the directory containing the images as an argument

3.       Your batch file should take the file extension of the extension of the image type to be resized as an argument.
 

For example, the following batch execution will resize all the GIF images in the current directory (note the period, ‘.’, is a shorthand for the current directory):

            websize  .  gif

The resulting files should be in a sub-directory named web-img\.
 

As another example, to resize all the jpeg files in a directory ..\images (note that ‘..’ refers to one directory above the current directory):

            websize ..\images jpg

which should leave all the resized images in ..\images\web-img\


You may use any resources to accomplish your assignment and you must include a remark in your batch file for each source of help other than homework and any slides or materials from class.  For example, 

            REM Found information on for loops in website http://www.loopsareus.com

You may find useful information on batch file arguments/parameters at https://ss64.com/nt/syntax-args.html. 
 

The assignment is due on Sunday, February 26 and will disappear from Blackboard on March 3 at midnight.  You will need to turn in your completed batch file for this assignment.  Make sure you include your name as a remark in the batch file.  
 

Rubric: 

Resizes picture files – 50%

Takes both directory and file extension arguments – 30%

Puts resized files in sub-directory – 10%

Well written and commented (use indentation and remarks) – 10%

5% extra credit for error check and message for whether directory exists

5% extra credit for adding the pixel width for resizing as an argument

More products