> - Do you wan't also the way to let the user specify the max_tbmp_size?
>    config.get_int ('max_tbmp_size', SimpleImageMaxSize)

I suppose, but it strikes me as an internal detail that the user
generally shouldn't care about.

> - The lines
> 
>               while len(newbits) > SimpleImageMaxSize:
>                   old_target_size = target_size
>                   target_size = 0.95 * target_size
>                   scaling_factor = math.sqrt(float(target_size)/float(len(newbits)))
>                   if self._verbose > 1:
> 
>   why do not write:
>                   
>               while len(newbits) > SimpleImageMaxSize:
>                   old_target_size = target_size
>                   target_size = SimpleImageMaxSize
>                   scaling_factor = math.sqrt(float(target_size)/float(len(newbits)))
>                   if self._verbose > 1:
> 
> 
>   and get in in one go?

We might not hit it on the first try, and we want to keep shrinking
the "target_size" till we do.  "SimpleImageMaxSize" is still the real
target size; "target_size" is just the value that we compute the new
dimensions from.  For the loop to terminate, we need to make sure the
target_size is continually reduced.

> - If the try_reduce_bpp get no result (tbmp that small enough) the
>   try_reduce_dimension are never tryed.

Yes, I know.  Not sure how "try_reduce_bpp" and "try_reduce_dimension"
should interact...  What do you suggest?

> - There are many unnecessary convert steps. If there are no tbmp
>   compression used the tbmp size could be calculated _without_
>   converting the tbmp first. And even if the convert from bmp to tbmp

But we don't know what command (in the netpbm2 case) the user has
selected to actually get the Palm images.  May or may not be
compression.  I don't think there's a general way of telling without
doing the actual conversion.

>   are needed more than one time, the step to convert the jpg/gif/png to
>   an bmp are need only once. Maybe we should sepperate the seps into:

If you look at the netpbm2 and pil2 cases, the conversion to the
intermediate format is done only once, in each of those classes.  In
the case of netpbm2, the intermediate format is PNM; in the pil2 case,
the intermediate format is PIL's own internal format.

The two steps you suggest are basically what the subclasses implement,
without the step of knowing about the compression (since we don't know
that, in general).

Thanks for the comments!

Bill

Reply via email to