-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (37 loc) · 1.02 KB
/
Copy pathmain.cpp
File metadata and controls
48 lines (37 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "main.hpp"
#include "pngReader.hpp"
#include "jpgReader.hpp"
int main(){
char path[CONST];
pathToFile(path);
printPath(path);
int checker = 0;
cout << "Image Reducer: 1 - on , 0 - None: ";
cin >> checker;
if(checker > 1 || checker < 0){
cout << "INVAILD INPUT: Defaulting to No Image Reducer (0)" << endl;
}
// read and determine photo type
int type;
type = determineFileType(path);
// reads the Photo based of type
switch (type){
case PNG:
// preform png
cout << "READING PNG FILE" << endl;
readPngFile(path, checker);
cout << "file finished reading" << endl;
break;
case JPG:
// preform jpg
cout << "READING JPG FILE" << endl;
readJpgFile(path, checker);
break;
default:
cerr << "File Type is not Supported!" << endl;
printPath(path);
exit(0);
break;
}
openOutputFileToScreen();
}