Commit 83f2738a authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

if the quality level is close to zero in non-interactive mode, use default

2003-02-05  Manish Singh  <yosh@gimp.org>

        * plug-ins/common/jpeg.c (run): if the quality level is close to zero
        in non-interactive mode, use default settings. This is hack until
        the PDB gets default arguments, so gimp-file-save works sanely with
        jpeg.
parent 01cd6507
2003-02-05 Manish Singh <yosh@gimp.org>
* plug-ins/common/jpeg.c (run): if the quality level is close to zero
in non-interactive mode, use default settings. This is hack until
the PDB gets default arguments, so gimp-file-save works sanely with
jpeg.
2003-02-05 Sven Neumann <sven@gimp.org>
* app/core/gimpobject.c (gimp_object_set_name_safe): replaced with
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
......@@ -503,21 +503,26 @@ run (gchar *name,
}
else
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
/* Once the PDB gets default parameters, remove this hack */
if (param[5].data.d_float > 0.05)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
jsvals.optimize = param[7].data.d_int32;
#ifdef HAVE_PROGRESSIVE_JPEG
jsvals.progressive = param[8].data.d_int32;
jsvals.progressive = param[8].data.d_int32;
#endif /* HAVE_PROGRESSIVE_JPEG */
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
jsvals.preview = FALSE;
jsvals.baseline = param[11].data.d_int32;
jsvals.subsmp = param[10].data.d_int32;
jsvals.restart = param[12].data.d_int32;
jsvals.dct = param[13].data.d_int32;
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
}
/* free up the default -- wasted some effort earlier */
g_free (image_comment);
image_comment = g_strdup (param[9].data.d_string);
jsvals.preview = FALSE;
if (jsvals.quality < 0.0 || jsvals.quality > 1.0)
status = GIMP_PDB_CALLING_ERROR;
......
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