Skip to content

Commit

Permalink
Show if the image is a progressive jpeg in view detail
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias-Wandel committed Mar 19, 2021
1 parent 1e83fdb commit af6e695
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 9 additions & 1 deletion browse/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,15 @@ void DoJpegView(char * ImagePath)
free(dir);

printf("<p>Date, time: %s<br>\n",ImageInfo.DateTime);
printf("Image size: %d x %d<br>\n",ImageInfo.Width, ImageInfo.Height);
printf("Image size: %d x %d",ImageInfo.Width, ImageInfo.Height);
if (ImageInfo.Process != 0xc0){
if (ImageInfo.Process == 0xc2){
printf(" (Progressive)");
}else{
printf(" (Process=%02x",ImageInfo.Process);
}
}
printf("<br>\n");

if (ImageInfo.ExposureTime || ImageInfo.ISOequivalent || ImageInfo.ApertureFNumber){
printf("Exposure: ");
Expand Down
2 changes: 2 additions & 0 deletions src/jhead.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ typedef struct {
char DateTime [20];
unsigned Height, Width;
int Orientation;
int IsColor;
int Process;
int FlashUsed;
float FocalLength;
float ExposureTime;
Expand Down
6 changes: 3 additions & 3 deletions src/jpgfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ static void process_SOFn (const uchar * Data, int marker)
num_components = Data[7];

if (num_components == 3){
//ImageInfo.IsColor = 1;
ImageInfo.IsColor = 1;
}else{
//ImageInfo.IsColor = 0;
ImageInfo.IsColor = 0;
}

//ImageInfo.Process = marker;
ImageInfo.Process = marker;

if (ShowTags){
printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n",
Expand Down

0 comments on commit af6e695

Please sign in to comment.