~ubuntu-branches/ubuntu/trusty/vips/trusty-proposed

« back to all changes in this revision

Viewing changes to libvips/foreign/jpegsave.c

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2014-03-29 12:29:29 UTC
  • mfrom: (1.1.21) (30.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20140329122929-fvxnaann32ex0gzk
Tags: 7.38.5-2
Enable dh-autoreconf. (Closes: #742872)

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
         */
84
84
        gboolean optimize_coding;
85
85
 
 
86
        /* Generate an interlaced (progressive, in jpg terminology) file.
 
87
         */
 
88
        gboolean interlace;
 
89
 
 
90
        /* Disable chroma subsampling. 
 
91
         */
 
92
        gboolean no_subsample;
 
93
 
86
94
} VipsForeignSaveJpeg;
87
95
 
88
96
typedef VipsForeignSaveClass VipsForeignSaveJpegClass;
123
131
                1, 100, 75 );
124
132
 
125
133
        VIPS_ARG_STRING( class, "profile", 11, 
126
 
                _( "profile" ), 
 
134
                _( "Profile" ), 
127
135
                _( "ICC profile to embed" ),
128
136
                VIPS_ARGUMENT_OPTIONAL_INPUT,
129
137
                G_STRUCT_OFFSET( VipsForeignSaveJpeg, profile ),
130
138
                NULL );
131
139
 
132
140
        VIPS_ARG_BOOL( class, "optimize_coding", 12,
133
 
                _( "optimize_coding" ),
 
141
                _( "Optimize_coding" ),
134
142
                _( "Compute optimal Huffman coding tables" ),
135
143
                VIPS_ARGUMENT_OPTIONAL_INPUT,
136
144
                G_STRUCT_OFFSET( VipsForeignSaveJpeg, optimize_coding ),
137
145
                FALSE );
 
146
 
 
147
        VIPS_ARG_BOOL( class, "interlace", 13,
 
148
                _( "Interlace" ),
 
149
                _( "Generate an interlaced (progressive) jpeg" ),
 
150
                VIPS_ARGUMENT_OPTIONAL_INPUT,
 
151
                G_STRUCT_OFFSET( VipsForeignSaveJpeg, interlace ),
 
152
                FALSE );
 
153
 
 
154
        VIPS_ARG_BOOL( class, "no_subsample", 14,
 
155
                _( "No subsample" ),
 
156
                _( "Disable chroma subsample" ),
 
157
                VIPS_ARGUMENT_OPTIONAL_INPUT,
 
158
                G_STRUCT_OFFSET( VipsForeignSaveJpeg, no_subsample ),
 
159
                FALSE );
 
160
 
138
161
}
139
162
 
140
163
static void
169
192
                return( -1 );
170
193
 
171
194
        if( vips__jpeg_write_file( save->ready, file->filename,
172
 
                jpeg->Q, jpeg->profile, jpeg->optimize_coding ) )
 
195
                jpeg->Q, jpeg->profile, jpeg->optimize_coding, 
 
196
                jpeg->interlace, save->strip, jpeg->no_subsample ) )
173
197
                return( -1 );
174
198
 
175
199
        return( 0 );
234
258
                return( -1 );
235
259
 
236
260
        if( vips__jpeg_write_buffer( save->ready, 
237
 
                &obuf, &olen, jpeg->Q, jpeg->profile, jpeg->optimize_coding ) )
 
261
                &obuf, &olen, jpeg->Q, jpeg->profile, jpeg->optimize_coding, 
 
262
                jpeg->interlace, save->strip, jpeg->no_subsample ) )
238
263
                return( -1 );
239
264
 
240
265
        area = vips_area_new_blob( (VipsCallbackFn) vips_free, obuf, olen );
295
320
                return( -1 );
296
321
 
297
322
        if( vips__jpeg_write_buffer( save->ready, 
298
 
                &obuf, &olen, jpeg->Q, jpeg->profile, jpeg->optimize_coding ) )
 
323
                &obuf, &olen, jpeg->Q, jpeg->profile, jpeg->optimize_coding, 
 
324
                jpeg->interlace, save->strip, jpeg->no_subsample ) )
299
325
                return( -1 );
300
326
 
301
327
        printf( "Content-length: %zd\r\n", olen );