transpic-cli 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "transpic-cli"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
4
  edition = "2024"
5
5
  publish = false
6
6
 
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # transpic-cli
2
+
3
+ A fast image manipulation CLI tool.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g transpic-cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ transpic --path <image> [options]
15
+ ```
16
+
17
+ At least one action flag is required.
18
+
19
+ ## Options
20
+
21
+ | Flag | Type | Description |
22
+ |------|------|-------------|
23
+ | `--path`, `-p` | `string` | Path to the input image *(required)* |
24
+ | `--format` | `string` | Convert output format (`png`, `jpg`, `webp`, …) |
25
+ | `--blur` | `float` | Apply blur with given intensity |
26
+ | `--grayscale` | `boolean` | Convert image to grayscale |
27
+ | `--invert` | `boolean` | Invert image colors |
28
+ | `--resize` | `WxH` | Resize image (e.g. `800x600`) |
29
+ | `--rotate` | `90\|180\|270` | Rotate image by given degrees |
30
+
31
+ ## Examples
32
+
33
+ ```bash
34
+ # Convert to WebP
35
+ transpic --path image.png --format webp
36
+
37
+ # Resize and convert
38
+ transpic --path photo.jpg --resize 1280x720 --format webp
39
+
40
+ # Grayscale + blur
41
+ transpic --path image.png --grayscale --blur 2
42
+
43
+ # Rotate and invert
44
+ transpic --path image.jpg --rotate 90 --invert
45
+ ```
46
+
47
+ ## License
48
+
49
+ [MIT](https://github.com/axtraz/transpic/blob/main/LICENSE)
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transpic-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A fast image manipulation CLI tool",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -13,10 +13,21 @@ if (!fs.existsSync(binDir)) {
13
13
  fs.mkdirSync(binDir, { recursive: true });
14
14
  }
15
15
 
16
+ if (!fs.existsSync(source)) {
17
+ console.error(`Error: Source binary not found at ${source}`);
18
+ console.error(`Please run 'cargo build --release' first on this platform.`);
19
+ process.exit(1);
20
+ }
21
+
16
22
  try {
17
23
  fs.copyFileSync(source, destination);
18
24
  console.log(`✓ Binary successfully copied to: ${destination}`);
25
+
26
+ if (process.platform !== 'win32') {
27
+ fs.chmodSync(destination, '755');
28
+ console.log(`✓ Execution permissions (chmod 755) applied.`);
29
+ }
19
30
  } catch (err) {
20
- console.error(`Error copying binary: ${err.message}`);
31
+ console.error(`Error during binary deployment: ${err.message}`);
21
32
  process.exit(1);
22
33
  }