1IM_JPEG2VIPS(3)            Library Functions Manual            IM_JPEG2VIPS(3)
2
3
4

NAME

6       im_jpeg2vips, im_vips2jpeg, im_vips2bufjpeg, im_vips2mimejpeg - convert
7       JPEG images to and from VIPS format
8

SYNOPSIS

10       #include <vips/vips.h>
11
12       int im_jpeg2vips( char *filename, IMAGE *out )
13
14       int im_jpeg2vips_header( char *filename, IMAGE *out )
15
16       int im_vips2jpeg( IMAGE *in, char *filename )
17
18       int im_vips2bufjpeg( IMAGE *in, IMAGE *base, char **obuf, int *olen )
19
20       int im_vips2mimejpeg( IMAGE *in )
21
22

DESCRIPTION

24       im_jpeg2vips() reads the named jpeg file and writes it to the specified
25       IMAGE.  The entire image is read before returning. It will handle 1 and
26       3 band 8-bit images only.
27
28       Any embedded ICC profiles are ignored: you always just the the RGB from
29       the file.
30
31       im_jpeg2vips_header()  reads just the header of the JPEG file, and sets
32       the fields in the VIPS image.  You can't read any pixels! This is  only
33       useful for printing header information.
34
35       im_vips2jpeg() writes the IMAGE to filename in JPEG format. It uses the
36       default settings of the IJG library.
37
38       A compression factor may be  encoded  in  the  filename:  for  example,
39       "fred.jpg"  will  write  with  the  default  compression  factor  (75),
40       "fred.jpg:25" will write with factor 25.
41
42       An   ICC   profile   may    also    be    specified.    For    example,
43       "fred.jpg:25,/home/john/srgb.icc"  will embed the profile stored in the
44       file "/home/john/srgb.icc" into the JPEG image. This  does  not  affect
45       the  pixels  which  are written, just the way they are tagged. Very few
46       image readers respect this tag.
47
48       im_vips2bufjpeg() returns the compressed image in a memory buffer.  The
49       buffer  is  allocated for you, local to IMAGE descriptor base. The size
50       of the allocated buffer is returned in  the  olen  parameter.  You  are
51       responsible for freeing the buffer. The buffer is only allocated if the
52       function returns successfully.
53
54       im_vips2mimejpeg() writes the image to  stdout  as  a  MIME  image/jpeg
55       type.  It  outputs  Content-Length  and  Content-Type fields making the
56       result suitable for a web browser.
57
58

SEE ALSO

60       im_isjpeg(3).
61
62
63
64                                  6 June 1994                  IM_JPEG2VIPS(3)
Impressum