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.


#define PSEUDO_IMAGE_MARKER   0x123;


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)


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

Macro Definition Documentation


#define PSEUDO_IMAGE_MARKER   0x123;

Definition at line 22 of file jpgfile.c.

Function Documentation

◆ CheckSectionsAllocated()

static void CheckSectionsAllocated ( void  )

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)

Definition at line 26 of file jpgfile.c.

Referenced by process_SOFn().

◆ process_COM()

static void process_COM ( const uchar Data,
int  length 

◆ process_SOFn()

static void process_SOFn ( const uchar Data,
int  marker 

◆ 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

Definition at line 18 of file jpgfile.c.

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

◆ ImageInfo

◆ Sections

◆ SectionsAllocated

int SectionsAllocated

Definition at line 16 of file jpgfile.c.

Referenced by CheckSectionsAllocated(), and ResetJpgfile().

◆ SectionsRead