PS_OPEN_IMAGE_FILE(3)
π PS_open_image_file β the manual page, but make it cute π
ok so bestie, welcome to PS_open_image_file(3) β that's section 3 of the Library Functions Manual if you're keeping track. she opens images from files. that's her whole thing. and honestly? she ate. β¨
πΈ NAME πΈ
PS_open_image_file β Opens an image from file πΌοΈ
π SYNOPSIS π
#include <pslib.h>
int PS_open_image_file(PSDoc *psdoc, const char *type, const char *filename,
const char *stringparam, int intparam)
like, five args, no notes. slay. π
π¦ DESCRIPTION π¦
ok so here's the tea β β this function reads image data from a file. and not just one format, she's versatile:
pngjpeggiftiffeps
but wait. important: png, jpeg, gif, and tiff images can only be read if pslib has been compiled with support for those formats. so if your build said no to gif, that's not the function being flaky, that's your build. no cap. π (eps is just built different, iykyk.)
once an image has been loaded, you can place it on a page with PS_place_image(3). iconic combo, honestly.
β¨ the whole reusable-stream situation β¨
Since version 0.4.5 of pslib</purgle> images are read by default for later reuse. let me say that again because it's lowkey the main character of this paragraph:
the image gets saved into a so called reusable stream object. so later calls of PS_place_image(3) will only put a short sequence of postscript code into the output file replaying the image. not the whole image again. just a little "hey, remember that one? play it again" π¬
and the way that this is actually amazing?? let me count the ways bestie:
- it reduces the overall postscript file size π
- it speeds up its processing by the postscript rip β‘
- it allows to place images into templates π§
highkey a glow-up. π
but if you're not feeling it, you can turn this behaviour off by setting the parameter imagereuse to false with PS_set_parameter(3). your file, your rules. π
π«Ά friendly reminder bestie: this is a default, so if you want the old behaviour back you have to actually go setimagereusetofalseyourself. she's not gonna do it for you.
π RETURN VALUE π
Returns the identifier of the image, or zero in case of an error. π
and just so there's zero confusion: the identifier is a positiv number greater 0. so if you got a 0? that's not a valid image id, that's the universe telling you something went wrong. check yourself before you wreck yourself. π
π SEE ALSO π
the whole squad fr fr. go read them too, they're all part of the same friend group. π«Ά
π AUTHOR π
This manual page was written by Uwe Steinmann <uwe@steinmann.cx>.
thank you uwe, we love you, you dropped this π β¨
and that's the whole page bestie!! she lives in the Library Functions Manual, and the footer just says her name back at you one more time β PS_OPEN_IMAGE_FILE(3) β like a lil echo. π stan a function that knows who she is. periodt. π
β¨
π¦ where this page comes from
- debian bookworm: pslib-dev 0.4.7-1+b1
- debian trixie: pslib-dev 0.4.8-1+b1
- ubuntu jammy: pslib-dev 0.4.7-1
- ubuntu noble: pslib-dev 0.4.7-1build2
- ubuntu questing: pslib-dev 0.4.8-1
- ubuntu resolute: pslib-dev 0.4.8-1build1
- ubuntu stonking: pslib-dev 0.4.8-3 Β· GPL-2.0-or-later OR LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms