From ed658cb8bdfb079ad939c2aee26ca012f623c3d4 Mon Sep 17 00:00:00 2001
From: Benson Muite
Date: Sat, 29 Mar 2025 15:39:11 +0300
Subject: [PATCH] tools: Use binary names that are not generic
Prevent installation conflicts.
---
.github/workflows/regression.yml | 4 +--
README.md | 42 ++++++++++++++++----------------
tools/lottie2gif/lottie2gif.cpp | 4 +--
tools/lottie2gif/meson.build | 2 +-
tools/svg2png/meson.build | 2 +-
tools/svg2png/svg2png.cpp | 2 +-
6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml
index 1c1c61fb..57ea0f18 100644
--- a/.github/workflows/regression.yml
+++ b/.github/workflows/regression.yml
@@ -152,7 +152,7 @@ jobs:
rm files.zip
cp test/regression/check_same_image_size.py check_same_image_size.py
# Forces to run tasks on different threads if possible, which should help find problem with data races
- taskset -c 0-15 python3 check_same_image_size.py AA_5.svg ./build/src/tools/svg2png/svg2png 100 500 2>&1 | tee result_image_size.txt
+ taskset -c 0-15 python3 check_same_image_size.py AA_5.svg ./build/src/tools/svg2png/tvg-svg2png 100 500 2>&1 | tee result_image_size.txt
- name: Check results
run: |
@@ -189,4 +189,4 @@ jobs:
if [[ -f "fail_ci.txt" ]]; then
echo "Check Check results section for more details which tests failed"
exit 1
- fi
\ No newline at end of file
+ fi
diff --git a/README.md b/README.md
index 3e66753f..0b292ccf 100644
--- a/README.md
+++ b/README.md
@@ -442,22 +442,22 @@ ThorVG provides the resource verification tool for the ThorVG Engine. [ThorVG vi
### Lottie to GIF
-ThorVG provides an executable `lottie2gif` converter that generates a GIF file from a Lottie file.
+ThorVG provides an executable `tvg-lottie2gif` converter that generates a GIF file from a Lottie file.
-To use the `lottie2gif`, you must turn on this feature in the build option:
+To use the `tvg-lottie2gif`, you must turn on this feature in the build option:
```
meson setup builddir -Dtools=lottie2gif -Dsavers=gif
```
-To use the 'lottie2gif' converter, you need to provide the 'Lottie files' parameter. This parameter can be a file name with the '.json' extension or a directory name. It also accepts multiple files or directories separated by spaces. If a directory is specified, the converter will search for files with the '.json' extension within that directory and all its subdirectories.
+To use the 'tvg-lottie2gif' converter, you need to provide the 'Lottie files' parameter. This parameter can be a file name with the '.json' extension or a directory name. It also accepts multiple files or directories separated by spaces. If a directory is specified, the converter will search for files with the '.json' extension within that directory and all its subdirectories.
Optionally, you can specify the image resolution in the 'WxH' format, with two numbers separated by an 'x' sign, following the '-r' flag.
Both flags, if provided, are applied to all of the `.json` files.
-The usage examples of the `lottie2gif`:
+The usage examples of the `tvg-lottie2gif`:
```
Usage:
- lottie2gif [Lottie file] or [Lottie folder] [-r resolution] [-f fps] [-b background color]
+ tvg-lottie2gif [Lottie file] or [Lottie folder] [-r resolution] [-f fps] [-b background color]
Flags:
-r set the output image resolution.
@@ -465,22 +465,22 @@ Flags:
-b specifies the base background color (RGB in hex). If not specified, the background color will follow the original content.
Examples:
- $ lottie2gif input.json
- $ lottie2gif input.json -f 30
- $ lottie2gif input.json -r 600x600 -f 30
- $ lottie2gif lottiefolder
- $ lottie2gif lottiefolder -r 600x600
- $ lottie2gif lottiefolder -r 600x600 -f 30 -b fa7410
+ $ tvg-lottie2gif input.json
+ $ tvg-lottie2gif input.json -f 30
+ $ tvg-lottie2gif input.json -r 600x600 -f 30
+ $ tvg-lottie2gif lottiefolder
+ $ tvg-lottie2gif lottiefolder -r 600x600
+ $ tvg-lottie2gif lottiefolder -r 600x600 -f 30 -b fa7410
```
### SVG to PNG
-ThorVG provides an executable `svg2png` converter that generates a PNG file from an SVG file.
+ThorVG provides an executable `tvg-svg2png` converter that generates a PNG file from an SVG file.
-To use the `svg2png`, you must turn on this feature in the build option:
+To use the `tvg-svg2png`, you must turn on this feature in the build option:
```
meson setup builddir -Dtools=svg2png
```
-To use the 'svg2png' converter, you need to provide the 'SVG files' parameter. This parameter can be a file name with the '.svg' extension or a directory name. It also accepts multiple files or directories separated by spaces. If a directory is specified, the converter will search for files with the '.svg' extension within that directory and all its subdirectories.
+To use the 'tvg-svg2png' converter, you need to provide the 'SVG files' parameter. This parameter can be a file name with the '.svg' extension or a directory name. It also accepts multiple files or directories separated by spaces. If a directory is specified, the converter will search for files with the '.svg' extension within that directory and all its subdirectories.
Optionally, you can specify the image resolution in the 'WxH' format, with two numbers separated by an 'x' sign, following the '-r' flag.
@@ -488,21 +488,21 @@ The background color can be set with the `-b` flag. The `bgColor` parameter shou
Both flags, if provided, are applied to all of the `.svg` files.
-The usage examples of the `svg2png`:
+The usage examples of the `tvg-svg2png`:
```
Usage:
- svg2png [SVG files] [-r resolution] [-b bgColor]
+ tvg-svg2png [SVG files] [-r resolution] [-b bgColor]
Flags:
-r set the output image resolution.
-b set the output image background color.
Examples:
- $ svg2png input.svg
- $ svg2png input.svg -r 200x200
- $ svg2png input.svg -r 200x200 -b ff00ff
- $ svg2png input1.svg input2.svg -r 200x200 -b ff00ff
- $ svg2png . -r 200x200
+ $ tvg-svg2png input.svg
+ $ tvg-svg2png input.svg -r 200x200
+ $ tvg-svg2png input.svg -r 200x200 -b ff00ff
+ $ tvg-svg2png input1.svg input2.svg -r 200x200 -b ff00ff
+ $ tvg-svg2png . -r 200x200
```
[Back to contents](#contents)
diff --git a/tools/lottie2gif/lottie2gif.cpp b/tools/lottie2gif/lottie2gif.cpp
index f0042f56..785065ff 100644
--- a/tools/lottie2gif/lottie2gif.cpp
+++ b/tools/lottie2gif/lottie2gif.cpp
@@ -54,7 +54,7 @@ private:
void helpMsg()
{
- cout << "Usage: \n lottie2gif [Lottie file] or [Lottie folder] [-r resolution] [-f fps] [-b background color]\n\nExamples: \n $ lottie2gif input.json\n $ lottie2gif input.json -r 600x600\n $ lottie2gif input.json -f 30\n $ lottie2gif input.json -r 600x600 -f 30\n $ lottie2gif lottiefolder\n $ lottie2gif lottiefolder -r 600x600 -f 30 -b fa7410\n\n";
+ cout << "Usage: \n tvg-lotie2gif [Lottie file] or [Lottie folder] [-r resolution] [-f fps] [-b background color]\n\nExamples: \n $ tvg-lotie2gif input.json\n $ tvg-lotie2gif input.json -r 600x600\n $ tvg-lotie2gif input.json -f 30\n $ tvg-lotie2gif input.json -r 600x600 -f 30\n $ tvg-lotie2gif lottiefolder\n $ tvg-lotie2gif lottiefolder -r 600x600 -f 30 -b fa7410\n\n";
}
bool validate(string& lottieName)
@@ -281,4 +281,4 @@ int main(int argc, char **argv)
{
App app;
return app.setup(argc, argv);
-}
\ No newline at end of file
+}
diff --git a/tools/lottie2gif/meson.build b/tools/lottie2gif/meson.build
index e23aa4d9..db5220d1 100644
--- a/tools/lottie2gif/meson.build
+++ b/tools/lottie2gif/meson.build
@@ -1,6 +1,6 @@
lottie2gif_src = files('lottie2gif.cpp')
-executable('lottie2gif',
+executable('tvg-lottie2gif',
lottie2gif_src,
include_directories : headers,
cpp_args : compiler_flags,
diff --git a/tools/svg2png/meson.build b/tools/svg2png/meson.build
index c9fe63b6..9395bfa7 100644
--- a/tools/svg2png/meson.build
+++ b/tools/svg2png/meson.build
@@ -1,6 +1,6 @@
svg2png_src = files('svg2png.cpp', 'lodepng.cpp')
-executable('svg2png',
+executable('tvg-svg2png',
svg2png_src,
include_directories : headers,
cpp_args : compiler_flags,
diff --git a/tools/svg2png/svg2png.cpp b/tools/svg2png/svg2png.cpp
index a52b522d..655a2437 100644
--- a/tools/svg2png/svg2png.cpp
+++ b/tools/svg2png/svg2png.cpp
@@ -288,7 +288,7 @@ private:
private:
int help()
{
- cout << "Usage:\n svg2png [SVG file] or [SVG folder] [-r resolution] [-b bgColor]\n\nFlags:\n -r set the output image resolution.\n -b set the output image background color.\n\nExamples:\n $ svg2png input.svg\n $ svg2png input.svg -r 200x200\n $ svg2png input.svg -r 200x200 -b ff00ff\n $ svg2png input1.svg input2.svg -r 200x200 -b ff00ff\n $ svg2png . -r 200x200\n\nNote:\n In the case, where the width and height in the SVG file determine the size of the image in resolution higher than 8k (7680 x 4320), limiting the resolution to this value is enforced.\n\n";
+ cout << "Usage:\n tvg-svg2png [SVG file] or [SVG folder] [-r resolution] [-b bgColor]\n\nFlags:\n -r set the output image resolution.\n -b set the output image background color.\n\nExamples:\n $ tvg-svg2png input.svg\n $ tvg-svg2png input.svg -r 200x200\n $ tvg-svg2png input.svg -r 200x200 -b ff00ff\n $ tvg-svg2png input1.svg input2.svg -r 200x200 -b ff00ff\n $ tvg-svg2png . -r 200x200\n\nNote:\n In the case, where the width and height in the SVG file determine the size of the image in resolution higher than 8k (7680 x 4320), limiting the resolution to this value is enforced.\n\n";
return 1;
}