Graphics programs in Steatite - Hypertopic/Steatite GitHub Wiki

Exiftool

  • Exiftool is used in metadata.php in the function getMetadata($resource)

  • The code run is exiftool -DateTimeOriginal -GPSPosition -d %Y-%m-%d -q -s2 $resource

  • Options used :

-d FMT (-dateFormat) Set format for date/time values

-s[NUM] (-short) Short output format. (Descriptions, not tag names, are shown by default when extracting information. )Prints tag names instead of descriptions. Add NUM or up to 3 -s options for even shorter formats:

-s2 or -s -s no extra spaces to column-align values

-q (-quiet) Quiet processing. One -q suppresses normal informational messages, and a second -q suppresses warnings as well. Error messages can not be suppressed, although minor errors may be downgraded to warnings with the -m option, which may then be suppressed with -q -q.

File

  • File is used in picture.php

  • The code run is file --brief --mime $source

  • A Multipurpose Internet Mail Extensions (MIME) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. It is defined and standardized in IETF RFC 6838.

Netpbm

  • Netpbm is used in thumbnail.php in the condition that the file exists

  • Netpbm is a package of graphics programs and a programming library.

  • The code run is anytopnm $source | pamcut -left=$x1 -top=$y1 -right=$x2 -bottom=$y2 | pnmscale -height 100 | pnmtojpeg >$destination

  • There are over 220 separate programs in the package, most of which have "pbm", "pgm", "ppm", "pam", or "pnm" in their names.In the project,anytopnm, pamcut, pnmscale and pnmtojpeg are used.

  • Documentation

anytopnm

  • Anytopnm converts the input image, which may be in any of about 100 graphics formats, to PBM, PGM, or PPM format, depending on that nature of the input image, and outputs it to Standard Output.

  • Documentation

pamcut

  • Pamcut reads a PAM, PBM, PGM, or PPM image as input and extracts the specified rectangle, and produces the same kind of image as output.

  • Options :

-left=colnum The column number of the leftmost column to be in the output. Columns left of this get cut out. If a nonnegative number, it refers to columns numbered from 0 at the left, increasing to the right. If negative, it refers to columns numbered -1 at the right, decreasing to the left.

-right=colnum The column number of the rightmost column to be in the output, numbered the same as for -left. Columns to the right of this get cut out.

-top=rownum The row number of the topmost row to be in the output. Rows above this get cut out. If a nonnegative number it refers to rows numbered from 0 at the top, increasing downward. If negative, it refers to columns numbered -1 at the bottom, decreasing upward.

-bottom=rownum The row number of the bottom-most row to be in the output, numbered the same as for -top. Rows below this get cut out.

pnmscale

  • Pnmscale is replaced by pamscale now.

  • Pamscale scales a Netpbm image by a specified factor, or scales individually horizontally and vertically by specified factors.

  • You can either enlarge (scale factor > 1) or reduce (scale factor < 1).

  • Options :

-heightcontrol the amount of scaling. -height specify the height in pixels you want the resulting image to be.

pnmtojpeg

  • Pnmtojpeg convert PNM image to a JFIF ("JPEG") image

  • Documentation