jpeg quality
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
jpeg quality
Im sure i have read this soemwhere but i cant find it. The jpeg quality settings have gone from the settings page. I have altered them via webmin but they seem to have no effect (yes i restarted)
Is this known?
Is this known?
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
not a problem mate. I assumed i was missing something glaringly obvious
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Possible Fix
This seems to be working for me:
tommy
Code: Select all
--- zm_image.cpp.original 2006-01-17 02:56:30.000000000 -0800
+++ zm_image.cpp 2006-03-24 15:37:13.000000000 -0800
@@ -270,6 +270,7 @@
cinfo->in_color_space = JCS_RGB; /* colorspace of input image */
}
jpeg_set_defaults( cinfo );
+ jpeg_set_quality( cinfo, quality, false );
cinfo->dct_method = JDCT_FASTEST;
jpeg_start_compress( cinfo, TRUE );
@@ -354,7 +355,7 @@
return( temp_image.EncodeJpeg( outbuffer, outbuffer_size, quality_override ) );
}
- int quality = quality_override?quality_override:config.jpeg_file_quality;
+ int quality = quality_override?quality_override:config.jpeg_image_quality;
struct jpeg_compress_struct *cinfo = jpg_ccinfo[quality];
@@ -380,6 +381,7 @@
cinfo->in_color_space = JCS_RGB; /* colorspace of input image */
}
jpeg_set_defaults( cinfo );
+ jpeg_set_quality( cinfo, quality, false );
cinfo->dct_method = JDCT_FASTEST;
jpeg_start_compress( cinfo, TRUE );
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
I have one before the start compress in Image::WriteJpeg and one before the start compress in Image::EncodeJpeg. Is one of those redundant?
I was implementing what I read at http://apodeline.free.fr/DOC/libjpeg/libjpeg-2.html
"You can set all the parameters to reasonable defaults by calling jpeg_set_defaults(); then, if there are particular values you want to change, you can do so after that. The "Compression parameter selection" section tells about all the parameters.
You must set in_color_space correctly before calling jpeg_set_defaults(), because the defaults depend on the source image colorspace. However the other three source image parameters need not be valid until you call jpeg_start_compress(). There's no harm in calling jpeg_set_defaults() more than once, if that happens to be convenient."
Wasn't this how it was done in previous versions of ZM?
thanks
tommy
I was implementing what I read at http://apodeline.free.fr/DOC/libjpeg/libjpeg-2.html
"You can set all the parameters to reasonable defaults by calling jpeg_set_defaults(); then, if there are particular values you want to change, you can do so after that. The "Compression parameter selection" section tells about all the parameters.
You must set in_color_space correctly before calling jpeg_set_defaults(), because the defaults depend on the source image colorspace. However the other three source image parameters need not be valid until you call jpeg_start_compress(). There's no harm in calling jpeg_set_defaults() more than once, if that happens to be convenient."
Wasn't this how it was done in previous versions of ZM?
thanks
tommy
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact: