<div dir="ltr"><div>Instead of the complication of a natural setting, how about I just make bitmaps refuse to convert themselves to svg-bytes (using the file/convertible interface anyway -- if you know you have a bitmap you can still convert it yourself). Then we can go back to just a list of symbols for the parameter setting and I think that's enough to make everything work out.</div>
<div><br></div><div>What do you think?</div><div><br>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 15, 2013 at 12:04 PM, Neil Toronto <span dir="ltr"><<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are their PNG bytes base64-encoded in an image tag inside the SVG? Or is it something less smart?<br>
<br>
Maybe the right thing to do is have each kind of convertible thing be able to specify its most natural encoding.<br>
<br>
Neil ⊥<div class="im"><br>
<br>
On 10/15/2013 10:37 AM, Robby Findler wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Oh, and another thought: it appears that the 2htdp/image documentation<br>
just went from 4 megs to 15 megs (of space on the disk) with the change<br>
to SVG. It looks like there are just two images that account for nearly<br>
10 megs, tho. So I could switch just those back to being pngs and that<br>
would make a big difference in the size. So maybe we also need<br>
finer-grained support to override the defaults in a few places?<br>
<br>
Or is there support for zipping them somehow? That appears to get a 10x<br>
improvement for one of the big ones.<br>
<br>
Robby<br>
<br>
<br>
On Tue, Oct 15, 2013 at 11:32 AM, Robby Findler<br></div><div class="im">
<<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a> <mailto:<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.<u></u>northwestern.edu</a>>> wrote:<br>

<br>
    Oh, right! Silly me. I've fixed 2htdp/image images so they can be<br>
    converted to svgs.<br>
<br>
    I've also adjusted the scribble html renderer so that it treats<br>
    the current-render-pict-as parameter as a suggestion on an ordering<br>
    (png first or svg first) instead of insisting that all convertible<br>
    things render as one or the other.<br>
<br>
    But now that I write this message, I'm thinking that it probably<br>
    makes more sense to have a parameter whose value is a list of<br>
    suggested conversions (the importance being the order) and that the<br>
    parameters names should be based around the word 'convertible'<br>
    instead of 'pict'.<br>
<br>
    Does that seem okay to you?<br>
<br>
    Robby<br>
<br>
<br>
    On Tue, Oct 15, 2013 at 4:46 AM, Jens Axel Søgaard<br></div><div class="im">
    <<a href="mailto:jensaxel@soegaard.net" target="_blank">jensaxel@soegaard.net</a> <mailto:<a href="mailto:jensaxel@soegaard.net" target="_blank">jensaxel@soegaard.net</a>><u></u>> wrote:<br>
<br>
        2013/10/15 Robby Findler <<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a><br></div>
        <mailto:<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.<u></u>northwestern.edu</a>>>:<div><div class="h5"><br>
         > I gave this a try and I'm just getting "???" in the image<br>
        docs. Below is my<br>
         > change to the image library. Does anyone know where the ???s<br>
        come from?<br>
<br>
        I was puzzled at first, but if I understand correctly, the HtDP<br>
        images<br>
        aren't picts but image-snips.<br>
<br>
        This implies that they don't get converted at line 585 in [1]<br>
        pict-lib/texpict/private/<u></u>mrpict-extra.rkt,<br>
        but that the conversion called is the one in [2]<br>
        gui-lib/mrlib/image-core.rkt at line 232.<br>
        I only made changes in the first one, not the second one.<br>
<br>
        I am unsure how to fix this - have the image snips still the<br>
        pict, or<br>
        have they become<br>
        become bitmaps at this point?<br>
<br>
        [1]<br>
        <a href="https://github.com/plt/racket/blob/5ed686d9911b9f0d1cb1d5cb58d6950e33b9d17c/pkgs/pict-pkgs/pict-lib/texpict/private/mrpict-extra.rkt#L585" target="_blank">https://github.com/plt/racket/<u></u>blob/<u></u>5ed686d9911b9f0d1cb1d5cb58d695<u></u>0e33b9d17c/pkgs/pict-pkgs/<u></u>pict-lib/texpict/private/<u></u>mrpict-extra.rkt#L585</a><br>

<br>
        [2]<br>
        <a href="https://github.com/plt/racket/blob/master/pkgs/gui-pkgs/gui-lib/mrlib/image-core.rkt#L232" target="_blank">https://github.com/plt/racket/<u></u>blob/master/pkgs/gui-pkgs/gui-<u></u>lib/mrlib/image-core.rkt#L232</a><br>

<br>
        /Jens Axel<br>
<br>
<br>
         > Robby<br>
         ><br>
         > ☕  git diff | cat<br>
         > diff --git<br>
         ><br>
        a/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image-guide.scrbl<br>
         ><br>
        b/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image-guide.scrbl<br>
         > index 8a625611..d66c922 100644<br>
         > ---<br>
        a/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image-guide.scrbl<br>
         > +++<br>
        b/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image-guide.scrbl<br>
         > @@ -12,7 +12,9 @@<br>
         >            "img-eval.rkt"<br>
         >            scribble/decode<br>
         >            scribble/manual<br>
         > -          scribble/eval)<br>
         > +          scribble/eval<br>
         > +          scribble/core<br>
         > +          scribble/html-properties)<br>
         ><br>
         >  @(define guide-eval (make-img-eval))<br>
         ><br>
         > @@ -35,8 +37,8 @@<br>
         >  @(interaction-eval #:eval guide-eval<br>
         >                     (require racket/list racket/local))<br>
         ><br>
         > -<br>
         > -@title[#:tag "image-guide"]{Image Guide}<br>
         > +@title[#:style (style "svg" (list (render-pict-as 'svg-images)))<br>
         > +               #:tag "image-guide"]{Image Guide}<br>
         ><br>
         >  This section introduces the @racketmodname[2htdp/image] library<br>
         >  through a series of increasingly complex image constructions<br>
         > diff --git<br>
        a/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image.scrbl<br>
         > b/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image.scrbl<br>
         > index 9c7d447..6f3cb39 100644<br>
         > ---<br>
        a/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image.scrbl<br>
         > +++<br>
        b/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/2htdp/scribblings/<u></u>image.scrbl<br>
         > @@ -34,7 +34,7 @@<br>
         >       (img-eval '(extra-margin 0))))<br>
         ><br>
         ><br>
         > -@teachpack["image"]{Images}<br>
         > +@teachpack[#:svg? #t "image"]{Images}<br>
         ><br>
         >  @(define mode/color-and-nitty-text<br>
         >     (make-splice<br>
         > diff --git<br>
        a/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/htdp/scribblings/<u></u>shared.rkt<br>
         > b/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/htdp/scribblings/<u></u>shared.rkt<br>
         > index 82ade26..b2c1b40 100644<br>
         > ---<br>
        a/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/htdp/scribblings/<u></u>shared.rkt<br>
         > +++<br>
        b/pkgs/htdp-pkgs/htdp-doc/<u></u>teachpack/htdp/scribblings/<u></u>shared.rkt<br>
         > @@ -1,12 +1,17 @@<br>
         >  #lang racket/base<br>
         ><br>
         > -(require scribble/manual)<br>
         > +(require scribble/manual<br>
         > +         scribble/core<br>
         > +         scribble/html-properties)<br>
         ><br>
         >  (provide teachpack<br>
         >           beginner-require)<br>
         ><br>
         > -(define (teachpack tp . name)<br>
         > +(define (teachpack #:svg? [svg? #f] tp . name)<br>
         >    (apply title #:tag tp<br>
         > +         #:style (if svg?<br>
         > +                     (style "svg" (list (render-pict-as<br>
        'svg-images)))<br>
         > +                     #f)<br>
         >           `(,@name ": " ,(filepath (format "~a.rkt" tp))<br>
         >             ,(index (format "~a teachpack" tp)))))<br>
         ><br>
         > ☕  [robby@yanpu]<br>
         > ~/git/plt/pkgs/htdp-pkgs/htdp-<u></u>doc/teachpack/2htdp/<u></u>scribblings<br>
         > ☕<br>
         ><br>
<br>
<br>
<br>
        --<br>
        --<br>
        Jens Axel Søgaard<br>
<br>
<br>
<br>
<br>
<br></div></div><div class="im">
____________________<br>
   Racket Users list:<br>
   <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
____________________<br>
 Racket Users list:<br>
 <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
</div></div></blockquote></div><br></div>