Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted sprites #18

Closed
patolo opened this issue Jul 14, 2014 · 9 comments
Closed

Corrupted sprites #18

patolo opened this issue Jul 14, 2014 · 9 comments

Comments

@patolo
Copy link

patolo commented Jul 14, 2014

Some of my sprites gets corrupted, not all, any suggestions on what to do?
'female-standing-normal': {
src: ['src/templates/assets/sprites/female-standing-normal'],
dest: '<%= site.destination %>/assets/sprites/female-standing-normal',
options: {
render: {
css: false,
scss: {
dest: 'sass/_sprite/female-standing-normal'
}
},
layout: 'horizontal'
}
}

@jkphl
Copy link
Collaborator

jkphl commented Jul 14, 2014

hi @patolo,

could you please provide more info? What do you mean with "corrupted"? Are they generated at all? Are graphical parts missing? What exactly is wrong about the sprites? Could you please provide the original SVG files? On which platform are your? ...

Cheers,
Joschi

@patolo
Copy link
Author

patolo commented Jul 14, 2014

Hi Joschi, here are my pics and sprite
/@patolo

On Mon, Jul 14, 2014 at 9:12 AM, Joschi Kuphal notifications@github.com
wrote:

hi @patolo https://github.com/patolo,

could you please provide more info? What do you mean with "corrupted"? Are
they generated at all? Are graphical parts missing? What exactly is wrong
about the sprites? Could you please provide the original SVG files? On
which platform are your? ...

Cheers,
Joschi


Reply to this email directly or view it on GitHub
#18 (comment)
.

Vänliga hälsningar,

Patrik Olofsson

mobile: +46 73-513 66 37

tretton37

Klostergatan 2

222 22 Lund

Sweden

tretton37.com http://tretton37.com/

@patolo
Copy link
Author

patolo commented Jul 14, 2014

I'm on ubuntu 12.04

@tolvstein
Copy link

I experience problems with corrupted sprites as well on Ubuntu 12.04

sprite-example

@tolvstein
Copy link

Example image attached

@jkphl
Copy link
Collaborator

jkphl commented Jul 19, 2014

hey guys,

thanks for your feedback, but both of you didn't really include the original SVG files, so I can't test myself (@patolo: Where should that link point to? It just takes me to your GitHub profile ...).

Have you tried playing with the SVGO optimizer options? Respectively have you already tried to disable SVG optimization altogether (via cleanwith: null)? SVGO with all plugins enabled tends to be somewhat aggressive and sometimes cripples certain SVG files. You should try disabling SVGO and see if your sprites still get corrupted. If not, then try to disable single SVGO plugins like so:

/* ... */
cleanconfig: {
    plugins: {
        {cleanupAttrs: false}
    }
}
/* ... */

For a list of all the active plugins please see the source code. Finally, you could also try to "fix" your SVG files (no idea if that's a valid suggestion at all and whether it is possible in your certain cases). Hope this helps.

Cheers,
Joschi

@tolvstein
Copy link

jkphl, thanks for your reply. FYI leaving cleanwith: NULL results in no sprite being generated at all. However this config change seems to have fixed my issue:

            cleanconfig: {
                plugins: [
                    {convertPathData: false}
                ]
            }

@jkphl
Copy link
Collaborator

jkphl commented Jul 21, 2014

Hey @tolvstein,

great! Yeah, that's what I meant when I said that SVGO is too aggressive sometimes (with certain SVGs). It's more a problem of SVGO than of svg-sprite ...

However, setting cleanwith: null should work — I'll check that, must be an error.

Thanks & cheers,
Joschi

@jkphl
Copy link
Collaborator

jkphl commented Dec 29, 2014

Hi @patolo & @tolvstein,

I just published the next major release of grunt-svg-sprite. It's rewritten from scratch and I'm pretty confident that disabling SVGO optimization altogether doesn't make any problems anymore — could you please check this? Still, configuring the SVGO plugins appropriately will be of importance, though ...

I'll close the issue for now, but please feel free to re-open it in case you've still got problems.

Cheers & a happy new year,
Joschi

@jkphl jkphl closed this as completed Dec 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants