[RkWard-devel] new export plugin

Prasenjit Kapat kapatp at gmail.com
Thu Feb 22 19:16:56 UTC 2007


Hi,

On 2/22/07, Thomas Friedrichsmeier
<thomas.friedrichsmeier at ruhr-uni-bochum.de> wrote:
> What I mean is this:
> - If either width/height, or both are specified, everything stays as is now.

Ok, makes sense.

> - Only in the case where neither is specified (both automatic) there'd be a
> change: Instead of displaying the message and forcing the user to supply at
> least one or the other, we'd cover up for png()/jpeg()'s strange requirement
> to give at least one parameter. That is, only in this case we'd use the code
> I suggested (or something like it), in all other cases it would remain as is.
>
> Pseudo-code:
> if ($png_jpeg && $width_automatic && $height_automatic) {
>         // png() and jpeg() need at least one of width/height
>         $width_option = ", width=par("din")[1]*" . $resolution;
> } else {
>         if (!$width_automatic) {
>                 $width_option = ", width=" . getRKval ("width");
>         }
>         // ...
> }
>
> Does it make sense, now?

Yes surely. What got me confused earlier (and then thinking!) is that
by this method, we can  set the width and height spinboxes to be
specified only in inches (avoiding the pixel-inches <logic>
alltogether in xml). For jpeg/png, we can use width=$width*$resolution
(height=$height*$resolution) when either of them is provided (in
inches) and your solution ("par("din")[1]".$resolution) when both are
auto. As for ps/pdf, the usual width=$width (height=$height), in
inches will work. Is this a "confusing oversimplification"?

My Pseudo code would look like this:

if ($png_jpeg) {
        $resolution = getRK_val ("resolution")
} else {
        $resolution = 1;
}
if ($png_jpeg && $width_automatic && $height_automatic) {
        // png() and jpeg() need at least one of width/height
        $width_option = ", width=par("din")[1]*" . $resolution;
} else {
        if (!$width_automatic) {
                $width_option = ", width=" . getRKval ("width")*$resolution;
        }
        // same for height..
}

Thats all! No more logic mess!

Regards
PK




More information about the Rkward-devel mailing list