Skip to content

ocodo/image-dims

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dims

Reference implementation C programs to return image dimensions of:

  • jpg
  • webp
  • png
  • bmp
  • gif

usage:

<bmp|gif|jpg|png|webp>dims <image.$1>

example:

pngdims input.png

output:

w: %i  h: %i

build:

e.g. gcc

# for webpdims...
gcc -O2 -o webpdims webpdims.c

Modify printf output and recompile.

Implementation is designed for modifcation and recompilation, as opposed to filtering output and remapping for purpose. High performance application target.

Notes:

png uses a fixed binary header strucure, and allows the fastest parsing.

Webp uses three internal payload structures, so it's slightly less efficient than png, which should be considered, ideal.

Jpeg uses SOF blocks to contain header info.

File integrity (i.e. is this a png? etc), upsteam concern.

About

Reference C implementations of image dimension scanning sole purpose programs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors