Commit 8e6ce453 authored by Raphaël Quinet's avatar Raphaël Quinet Committed by Raphaël Quinet
Browse files

applied a (slightly modified) patch from keith@goatman.me.uk, fixing a

2004-01-08  Raphaël Quinet  <quinet@gamers.org>

	* plug-ins/common/jpeg.c: applied a (slightly modified) patch from
	keith@goatman.me.uk, fixing a problem with the save dialog for
	grayscale images and a small rounding error in the JPEG quality
	level.  Fixes bug #130912.
parent f2c121b9
2004-01-08 Raphaël Quinet <quinet@gamers.org>
* plug-ins/common/jpeg.c: applied a (slightly modified) patch from
keith@goatman.me.uk, fixing a problem with the save dialog for
grayscale images and a small rounding error in the JPEG quality
level. Fixes bug #130912.
2004-01-08 Henrik Brix Andersen <brix@gimp.org>
 
* app/config/gimpdisplayconfig.c: added %D* to
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
......@@ -1347,7 +1347,8 @@ save_image (const gchar *filename,
*/
jpeg_set_defaults (&cinfo);
jpeg_set_quality (&cinfo, (gint) (jsvals.quality * 100), jsvals.baseline);
jpeg_set_quality (&cinfo, (gint) ((jsvals.quality + 0.005) * 100),
jsvals.baseline);
cinfo.smoothing_factor = (gint) (jsvals.smoothing * 100);
cinfo.optimize_coding = jsvals.optimize;
......@@ -1892,6 +1893,10 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
/* DCT method */
menu =
gimp_int_option_menu_new (FALSE,
......@@ -1909,10 +1914,6 @@ save_dialog (void)
1.0, 0.5,
menu, 1, FALSE);
dtype = gimp_drawable_type (drawable_ID_global);
if (dtype != GIMP_RGB_IMAGE && dtype != GIMP_RGBA_IMAGE)
gtk_widget_set_sensitive (menu, FALSE);
com_frame = gtk_frame_new (_("Image comments"));
gtk_box_pack_start (GTK_BOX (main_vbox), com_frame, TRUE, TRUE, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment