width/height return values with lazy.

View: New views
3 Messages — Rating Filter:   Alert me  

width/height return values with lazy.

by Raimund Berger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hey

sorry for jumping in again, but I noticed a change which gives me some
trouble with a couple of scripts scripts right now.

Specifically, rrdgraph seems to not anymore return image width and
height with lazy option and when the image is up to date. Looks like
this behavior changed somewhere on the way from 1.2 to 1.3 .

I guess in Perl, I could also use graphv and take the return hash
apart. But I'd still like to know whether this is a slipup or
intent. Any light shed highly appreciated.

Thanks,
R.

_______________________________________________
rrd-users mailing list
rrd-users@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Re: width/height return values with lazy.

by Tobias Oetiker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Raimund,

the fix in r1439 ...

this is the minimal patch ...

--- src/rrd_graph.c     (revision 1438)
+++ src/rrd_graph.c     (working copy)
@@ -2951,8 +2951,13 @@
     PangoFontMap *font_map = pango_cairo_font_map_get_default();

     /* if we are lazy and there is nothing to PRINT ... quit now */
-    if (lazy && im->prt_c == 0)
+    if (lazy && im->prt_c == 0) {
+        info.u_cnt = im->ximg;
+        grinfo_push(im, sprintf_alloc("image_width"), RD_I_CNT, info);
+        info.u_cnt = im->yimg;
+        grinfo_push(im, sprintf_alloc("image_height"), RD_I_CNT, info);
         return 0;
+    }
     /* pull the data from the rrd files ... */
     if (data_fetch(im) == -1)
         return -1;

cheers
tobi

Yesterday Raimund Berger wrote:

>
> Hey
>
> sorry for jumping in again, but I noticed a change which gives me some
> trouble with a couple of scripts scripts right now.
>
> Specifically, rrdgraph seems to not anymore return image width and
> height with lazy option and when the image is up to date. Looks like
> this behavior changed somewhere on the way from 1.2 to 1.3 .
>
> I guess in Perl, I could also use graphv and take the return hash
> apart. But I'd still like to know whether this is a slipup or
> intent. Any light shed highly appreciated.
>
> Thanks,
> R.
>
> _______________________________________________
> rrd-users mailing list
> rrd-users@...
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi@... ++41 62 775 9902 / sb: -9900

_______________________________________________
rrd-users mailing list
rrd-users@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Re: width/height return values with lazy.

by Raimund Berger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tobias Oetiker <tobi@...> writes:

> Hi Raimund,
>
> the fix in r1439 ...
>
> this is the minimal patch ...
>
> --- src/rrd_graph.c     (revision 1438)
> +++ src/rrd_graph.c     (working copy)
> @@ -2951,8 +2951,13 @@
>      PangoFontMap *font_map = pango_cairo_font_map_get_default();
>
>      /* if we are lazy and there is nothing to PRINT ... quit now */
> -    if (lazy && im->prt_c == 0)
> +    if (lazy && im->prt_c == 0) {
> +        info.u_cnt = im->ximg;
> +        grinfo_push(im, sprintf_alloc("image_width"), RD_I_CNT, info);
> +        info.u_cnt = im->yimg;
> +        grinfo_push(im, sprintf_alloc("image_height"), RD_I_CNT, info);
>          return 0;
> +    }
>      /* pull the data from the rrd files ... */
>      if (data_fetch(im) == -1)
>          return -1;

Much obliged, many thanks for the helpful response, R.

_______________________________________________
rrd-users mailing list
rrd-users@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
LightInTheBox - Buy quality products at wholesale price