jhead  3.04
About: jhead is an Exif Jpeg header and thumbnail manipulation tool.
  Fossies Dox: jhead-3.04.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

jpgfile.c File Reference
#include "jhead.h"
Include dependency graph for jpgfile.c:

Go to the source code of this file.

Macros

#define PSEUDO_IMAGE_MARKER   0x123;
 

Functions

static int Get16m (const void *Short)
 
static void process_COM (const uchar *Data, int length)
 
static void process_SOFn (const uchar *Data, int marker)
 
static void CheckSectionsAllocated (void)
 
int ReadJpegSections (FILE *infile, ReadMode_t ReadMode)
 
void DiscardData (void)
 
int ReadJpegFile (const char *FileName, ReadMode_t ReadMode)
 
int SaveThumbnail (char *ThumbFileName)
 
int ReplaceThumbnail (const char *ThumbFileName)
 
void DiscardAllButExif (void)
 
void WriteJpegFile (const char *FileName)
 
Section_tFindSection (int SectionType)
 
int RemoveSectionType (int SectionType)
 
int RemoveUnknownSections (void)
 
Section_tCreateSection (int SectionType, unsigned char *Data, int Size)
 
void ResetJpgfile (void)
 

Variables

ImageInfo_t ImageInfo
 
static Section_tSections = NULL
 
static int SectionsAllocated
 
static int SectionsRead
 
static int HaveAll
 

Macro Definition Documentation

◆ PSEUDO_IMAGE_MARKER

#define PSEUDO_IMAGE_MARKER   0x123;

Definition at line 22 of file jpgfile.c.

Function Documentation

◆ CheckSectionsAllocated()

static void CheckSectionsAllocated ( void  )
static

Definition at line 101 of file jpgfile.c.

References ErrFatal(), Sections, SectionsAllocated, and SectionsRead.

Referenced by CreateSection(), DiscardAllButExif(), and ReadJpegSections().

◆ CreateSection()

Section_t* CreateSection ( int  SectionType,
unsigned char *  Data,
int  Size 
)

◆ DiscardAllButExif()

void DiscardAllButExif ( void  )

Definition at line 513 of file jpgfile.c.

References CheckSectionsAllocated(), M_COM, M_EXIF, M_IPTC, M_XMP, Sections, SectionsRead, and Section_t::Type.

Referenced by ProcessFile().

◆ DiscardData()

void DiscardData ( void  )

Definition at line 349 of file jpgfile.c.

References HaveAll, ImageInfo, Sections, and SectionsRead.

Referenced by ProcessFile(), and ReadJpegFile().

◆ FindSection()

Section_t* FindSection ( int  SectionType)

Definition at line 640 of file jpgfile.c.

References Sections, and SectionsRead.

Referenced by CheckFileSkip(), ProcessFile(), ReplaceThumbnail(), and SaveThumbnail().

◆ Get16m()

static int Get16m ( const void *  Short)
static

Definition at line 26 of file jpgfile.c.

Referenced by process_SOFn().

◆ process_COM()

static void process_COM ( const uchar Data,
int  length 
)
static

◆ process_SOFn()

static void process_SOFn ( const uchar Data,
int  marker 
)
static

◆ ReadJpegFile()

int ReadJpegFile ( const char *  FileName,
ReadMode_t  ReadMode 
)

Definition at line 365 of file jpgfile.c.

References DiscardData(), FALSE, READ_ANY, ReadJpegSections(), and TRUE.

Referenced by ProcessFile().

◆ ReadJpegSections()

◆ RemoveSectionType()

int RemoveSectionType ( int  SectionType)

Definition at line 656 of file jpgfile.c.

References FALSE, Sections, SectionsRead, and TRUE.

Referenced by create_EXIF(), and ProcessFile().

◆ RemoveUnknownSections()

int RemoveUnknownSections ( void  )

◆ ReplaceThumbnail()

◆ ResetJpgfile()

void ResetJpgfile ( void  )

Definition at line 766 of file jpgfile.c.

References HaveAll, Sections, SectionsAllocated, and SectionsRead.

Referenced by ProcessFile().

◆ SaveThumbnail()

int SaveThumbnail ( char *  ThumbFileName)

◆ WriteJpegFile()

Variable Documentation

◆ HaveAll

int HaveAll
static

Definition at line 18 of file jpgfile.c.

Referenced by DiscardData(), ReadJpegSections(), ResetJpgfile(), and WriteJpegFile().

◆ ImageInfo

◆ Sections

◆ SectionsAllocated

int SectionsAllocated
static

Definition at line 16 of file jpgfile.c.

Referenced by CheckSectionsAllocated(), and ResetJpgfile().

◆ SectionsRead