Changeset 115817 in spip-zone


Ignore:
Timestamp:
Jun 28, 2019, 1:12:05 PM (8 months ago)
Author:
cedric@…
Message:

C'est tres preliminaire et proof of concept, a optimiser pour etre exploitable, mais voici une premiere version d'un generateur de preview SVG a base de Primitives, base sur https://github.com/Tw1ddle/geometrize-haxe

Location:
_plugins_/adaptive_images/trunk
Files:
51 added
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/adaptive_images/trunk/adaptive_images_options.php

    r115810 r115817  
    214214}
    215215
     216function adaptive_images_preview_geometrize($image, $options) {
     217        $geometrize = charger_fonction("image_geometrize", "preview");
     218        //spip_timer('potrace');
     219        if ($thumbnail = $geometrize($image, $options)) {
     220                //var_dump($thumbnail,filesize($thumbnail),spip_timer('potrace'));
     221                return array($thumbnail, 'potrace');
     222        }
     223        //spip_timer('potrace');
     224        return false;
     225}
     226
    216227/** Filtres  ***********************************************************************************************************/
    217228
  • _plugins_/adaptive_images/trunk/preview/image_potrace.php

    r115810 r115817  
    7575
    7676                // optimize the size : round all points to integer
    77                 $svg_image[1] = preg_replace_callback(",\b(\d+\.\d+)\b,ims", "svg_sound_point", $svg_image[1]);
     77                $svg_image[1] = preg_replace_callback(",\b(\d+\.\d+)\b,ims", "svg_round_point", $svg_image[1]);
    7878                $svg_image[1] = str_replace("black", "#".$couleur_dark, $svg_image[1]);
    7979                $svg_image = $svg_image[0] . $svg_image[1];
     
    8989}
    9090
    91 function svg_sound_point($m) {
     91function svg_round_point($m) {
    9292        return round($m[0]);
    9393}
Note: See TracChangeset for help on using the changeset viewer.