Skip to content

non-conforming drawing primitive definition `push' #241

Description

@arxeiss

Hello,

recently library started to fail in my hosting. I know nothing changed in your code. But is it possible this is caused by updated ImageMagick?

I'm getting this error non-conforming drawing primitive definition `push' @ error/draw.c/RenderMVGContent/4428. I was trying to fix issues with Locale as shown in this bug ticket Imagick/imagick#779

However changing locale does nothing (by default I have C anyway). And in that bug report issue is near 3 as a number. I see error in push. What I have noticed is, that this is not happening if I remove gradient.

    $settings = [
        'size'            => 400,
        'correctionLevel' => ErrorCorrectionLevel::M(),
        'encoding'        => Encoder::DEFAULT_BYTE_MODE_ENCODING,
        'margin'          => 4,
    ];

    $renderer = new ImageRenderer(
        new RendererStyle($settings['size'], $settings['margin'], null, null, Fill::uniformGradient(
            new Alpha(0, new Rgb(0, 0, 0)),
            new Gradient(new Rgb(14, 103, 143), new Rgb(78, 78, 78), GradientType::VERTICAL()),
        )),
        new ImagickImageBackEnd(),
    );

    $binary = $writer->writeString($this->getCodeContent(), $settings['encoding'], $settings['correctionLevel']);

Not sure it can help, but I have used getVectorGraphics() from ImagickDraw. There is 1.3MB of base64. But I tried to trim that out a bit:

<drawing-wand><clip-path/><clip-units>Undefined</clip-units><decorate>None</decorate><encoding/><fill>#000000000000</fill><fill-opacity>1</fill-opacity><fill-rule>Evenodd</fill-rule><font/><font-family/><font-size>12</font-size><font-stretch>Undefined</font-stretch><font-style>Undefined</font-style><font-weight>0</font-weight><gravity>Undefined</gravity><stroke>#FFFFFFFFFFFFFFFF</stroke><stroke-antialias>1</stroke-antialias><stroke-dasharray/><stroke-dashoffset>0</stroke-dashoffset><stroke-linecap>Butt</stroke-linecap><stroke-linejoin>Miter</stroke-linejoin><stroke-miterlimit>10</stroke-miterlimit><stroke-opacity>0</stroke-opacity><stroke-width>1</stroke-width><text-align>Undefined</text-align><text-antialias>1</text-antialias><text-undercolor>#000000000000FFFF</text-undercolor><vector-graphics>scale 13.793103448275861211 13.793103448275861211
translate 4 4
push pattern g1 0 0 344.82758620689651252 344.82758620689651252
 image Copy 0 0 344.82758620689651252 344.82758620689651252 'data:image/x-gradient;base64,
 aWQ9SW1hZ2VNYWdpY2sgIHZlcnNpb249MS4wCmNsYXNzPURpcmVjdENsYXNzICBjb2xvcnM9MCAg
 bWF0dGU9VHJ1ZQpjb2x1bW5zPTM0NCAgcm93cz0zNDQgIGRlcHRoPTE2CmNvbG9yc3BhY2U9c1JH
...
...
...
//w=='
pop pattern
fill url(#g1)
path 'M12 1L12 5 11 5 11 4 9 4 9 2 8 2 8 8 9 8 9 9 10 9 10 10 12 10 12 11
 10 11 10 12 9 12 9 13 8 13 8 14 9 14 9 13 11 13 11 12 12 12 12 14 10 14 10 16
 9 16 9 15 8 15 8 19 10 19 10 20 12 20 12 21 13 21 13 20 15 20 15 21 16 21
 16 17 17 17 17 20 18 20 18 21 19 21 19 19 18 19 18 18 19 18 19 16 21 16 21 15
 18 15 18 16 17 16 17 14 16 14 16 12 15 12 15 11 16 11 16 10 15 10 15 9 17 9
 17 10 18 10 18 12 17 12 17 13 18 13 18 12 19 12 19 14 20 14 20 13 21 13 21 12
 19 12 19 11 21 11 21 10 20 10 20 9 19 9 19 8 14 8 14 9 12 9 12 8 11 8 11 9
 10 9 10 7 11 7 11 6 12 6 12 7 13 7 13 6 12 6 12 5 13 5 13 1ZM10 2L10 3 11 3
 11 2ZM10 5L10 6 9 6 9 7 10 7 10 6 11 6 11 5ZM0 8L0 10 1 10 1 11 0 11 0 12
 1 12 1 13 4 13 4 12 5 12 5 11 7 11 7 10 5 10 5 11 4 11 4 9 7 9 7 8 2 8 2 9
 1 9 1 8ZM2 10L2 12 3 12 3 10ZM8 10L8 11 9 11 9 10ZM13 10L13 11 14 11 14 10Z
M6 12L6 13 7 13 7 12ZM13 12L13 14 12 14 12 15 11 15 11 16 10 16 10 19 12 19
 12 18 11 18 11 16 12 16 12 17 13 17 13 16 14 16 14 17 16 17 16 16 15 16 15 15
 16 15 16 14 15 14 15 12ZM13 14L13 15 14 15 14 14ZM13 18L13 19 14 19 14 18Z
M20 19L20 20 21 20 21 19ZM8 20L8 21 9 21 9 20ZM0 0L0 7 7 7 7 0ZM1 1L1 6 6 6
 6 1ZM2 2L2 5 5 5 5 2ZM21 0L14 0 14 7 21 7ZM20 1L15 1 15 6 20 6ZM19 2L16 2
 16 5 19 5ZM0 21L7 21 7 14 0 14ZM1 20L6 20 6 15 1 15ZM2 19L5 19 5 16 2 16Z'
</vector-graphics> </drawing-wand>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions