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

IMPROVEMENT: add an arg to skip non svg files #250

Open
alefwd opened this issue Jul 30, 2024 · 1 comment
Open

IMPROVEMENT: add an arg to skip non svg files #250

alefwd opened this issue Jul 30, 2024 · 1 comment

Comments

@alefwd
Copy link

alefwd commented Jul 30, 2024

I have a folder /assets where I have a mix of svgs and json files, and I cannot change this. I would like to be able to apply the vector_graphics_compiler transformation to the folder.
When I tried something like:

    - path: assets/
      transformers:
        - package: vector_graphics_compiler

I received exceptions relative to transforming the json files.

What I propose is either to skip non svg files by default, or to enable it using an arg:

    - path: assets/
      transformers:
        - package: vector_graphics_compiler
           args: ['--svg-only']
@t-unit
Copy link

t-unit commented Aug 9, 2024

I also run into this sometimes with files generated by the OS, very annoying. E.g. for .DS_Store:

Target debug_android_application failed: Error: User-defined transformation of asset "/Users/***/assets/vector/.DS_Store" failed.
Transformer process terminated with non-zero exit code: 1
Transformer package: vector_graphics_compiler
Full command: /Users/***/flutter/bin/cache/dart-sdk/bin/dart run vector_graphics_compiler --input=/var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput0 --output=/var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput1
stdout:
XXXXXXXXXXX /var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput0 XXXXXXXXXXXXX
FileSystemException: Failed to decode data using encoding 'utf-8', path = '/var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput0'
#0      _File._tryDecode (dart:io/file_impl.dart:615:7)
#1      _File.readAsStringSync (dart:io/file_impl.dart:624:7)
#2      IsolateProcessor._process.<anonymous closure> (file:///Users/***/.pub-cache/hosted/pub.dev/vector_graphics_compiler-1.1.11+1/bin/util/isolate_processor.dart:110:37)
isolate_processor.dart:110
#3      _RemoteRunner._run (dart:isolate:1090:47)
#4      _RemoteRunner._remoteExecute (dart:isolate:1084:12)
#5      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:17)
#6      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

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

2 participants