krpanos-tools 1.0.0 → 1.0.2
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/INSTALL +57 -0
- package/LICENSE +21 -0
- package/README.md +157 -0
- package/assets/banner.jpg +0 -0
- package/assets/logo.jpg +0 -0
- package/package.json +35 -6
package/INSTALL
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Global install (recommended)
|
|
4
|
+
|
|
5
|
+
Install the package globally to use the CLI commands anywhere:
|
|
6
|
+
|
|
7
|
+
npm install -g krpanos-tools
|
|
8
|
+
|
|
9
|
+
This makes the following commands available:
|
|
10
|
+
|
|
11
|
+
panos-geotag Assign GPS coordinates to panoramic images
|
|
12
|
+
panos-excel Export image EXIF metadata to Excel
|
|
13
|
+
panos-faces Convert equirectangular images to cubemap faces
|
|
14
|
+
|
|
15
|
+
## Local install
|
|
16
|
+
|
|
17
|
+
npm install krpanos-tools
|
|
18
|
+
|
|
19
|
+
Then run commands via npx:
|
|
20
|
+
|
|
21
|
+
npx panos-faces -i ./my-panos -o cubes
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
- Node.js >= 16
|
|
26
|
+
- ExifTool (bundled via exiftool-vendored, no manual install needed)
|
|
27
|
+
- The `canvas` native module requires build tools on some platforms:
|
|
28
|
+
|
|
29
|
+
**Windows:**
|
|
30
|
+
No extra steps needed (prebuilt binaries are downloaded).
|
|
31
|
+
|
|
32
|
+
**macOS:**
|
|
33
|
+
brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman
|
|
34
|
+
|
|
35
|
+
**Linux (Debian/Ubuntu):**
|
|
36
|
+
sudo apt-get install -y build-essential libcairo2-dev \
|
|
37
|
+
libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
|
|
38
|
+
|
|
39
|
+
## Build from source
|
|
40
|
+
|
|
41
|
+
Clone the repository and install dependencies:
|
|
42
|
+
|
|
43
|
+
git clone https://github.com/youmtinet/krpanos-tools.git
|
|
44
|
+
cd krpanos-tools
|
|
45
|
+
yarn install
|
|
46
|
+
|
|
47
|
+
Build the CLI bundles:
|
|
48
|
+
|
|
49
|
+
yarn build
|
|
50
|
+
|
|
51
|
+
The bundled scripts are output to `dist/`.
|
|
52
|
+
|
|
53
|
+
## Verify installation
|
|
54
|
+
|
|
55
|
+
panos-faces --help
|
|
56
|
+
panos-geotag --help
|
|
57
|
+
panos-excel --help
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Younes Mrabti
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# krpanos-tools
|
|
2
|
+
<div align="center">
|
|
3
|
+
<img src="assets/banner.jpg" alt="krpanos-tools logo"/>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
A set of CLI tools for processing equirectangular panoramic images: geotagging, cube face generation, and Excel metadata export.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g krpanos-tools
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## CLI Commands
|
|
15
|
+
|
|
16
|
+
### `panos-geotag`
|
|
17
|
+
|
|
18
|
+
Assigns GPS coordinates and heading to panoramic images using data from a GeoJSON file.
|
|
19
|
+
|
|
20
|
+
**Usage:**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
panos-geotag [options]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Options:**
|
|
27
|
+
|
|
28
|
+
| Option | Description | Default |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `-i, --imagesFolder <path>` | Path to the images folder | `.` |
|
|
31
|
+
| `-j, --jsonFile <string>` | GeoJSON filename | `imagesdir.json` |
|
|
32
|
+
|
|
33
|
+
**GeoJSON format:**
|
|
34
|
+
|
|
35
|
+
The JSON file must follow GeoJSON `FeatureCollection` structure with each feature containing:
|
|
36
|
+
|
|
37
|
+
- `properties.pano` — image filename
|
|
38
|
+
- `properties.latitude` — GPS latitude
|
|
39
|
+
- `properties.longitude` — GPS longitude
|
|
40
|
+
- `heading` (optional) — GPS image direction (random if omitted)
|
|
41
|
+
|
|
42
|
+
**Example:**
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
panos-geotag -i ./my-panos -j geodata.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### `panos-faces`
|
|
51
|
+
|
|
52
|
+
Converts equirectangular panoramic images into cubemap faces (6 faces per image), generates a preview strip and a thumbnail, and exports image metadata to an Excel file.
|
|
53
|
+
|
|
54
|
+
**Usage:**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
panos-faces [options]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Options:**
|
|
61
|
+
|
|
62
|
+
| Option | Description | Default |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `-i, --imagesFolder <path>` | Path to the images folder | `.` |
|
|
65
|
+
| `-o, --outputFolder <path>` | Path to the output folder (relative to images folder) | `cubes` |
|
|
66
|
+
| `-u, --urlPanos <type>` | Base URL for panoramas in the exported Excel | `/panos/` |
|
|
67
|
+
|
|
68
|
+
**Output structure:**
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
<outputFolder>/
|
|
72
|
+
<image_name>/
|
|
73
|
+
pano_f.jpg # front face
|
|
74
|
+
pano_b.jpg # back face
|
|
75
|
+
pano_u.jpg # up face
|
|
76
|
+
pano_d.jpg # down face
|
|
77
|
+
pano_l.jpg # left face
|
|
78
|
+
pano_r.jpg # right face
|
|
79
|
+
preview.jpg # 256×1536 vertical strip of all faces
|
|
80
|
+
thumb.jpg # 240×240 thumbnail (front face)
|
|
81
|
+
excel/
|
|
82
|
+
<timestamp>.xlsx
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Example:**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
panos-faces -i ./static -o cubes -u /panos/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### `panos-excel`
|
|
94
|
+
|
|
95
|
+
Reads EXIF metadata (GPS coordinates, date, heading) from panoramic images and exports it to an Excel file. Headings are computed as rhumb line bearings between consecutive images.
|
|
96
|
+
|
|
97
|
+
**Usage:**
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
panos-excel [options]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Options:**
|
|
104
|
+
|
|
105
|
+
| Option | Description | Default |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| `-i, --imagesFolder <path>` | Path to the images folder | `.` |
|
|
108
|
+
| `-u, --urlPanos <type>` | Base URL for panoramas in the exported Excel | `/panos/` |
|
|
109
|
+
|
|
110
|
+
**Output:**
|
|
111
|
+
|
|
112
|
+
An `.xlsx` file is created in `excel/<timestamp>.xlsx` with columns:
|
|
113
|
+
|
|
114
|
+
| Column | Description |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `url_pano` | Base URL prefix |
|
|
117
|
+
| `pano` | Image name (without extension) |
|
|
118
|
+
| `date` | Original capture date (ISO 8601) |
|
|
119
|
+
| `latitude` | GPS latitude |
|
|
120
|
+
| `longitude` | GPS longitude |
|
|
121
|
+
| `heading` | Rhumb line bearing to the next image |
|
|
122
|
+
|
|
123
|
+
**Example:**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
panos-excel -i ./static -u /panos/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Supported Image Formats
|
|
130
|
+
|
|
131
|
+
`.jpg`, `.jpeg`, `.png`, `.tiff`
|
|
132
|
+
|
|
133
|
+
## Dependencies
|
|
134
|
+
|
|
135
|
+
- [exiftool-vendored](https://www.npmjs.com/package/exiftool-vendored) — EXIF read/write
|
|
136
|
+
- [canvas](https://www.npmjs.com/package/canvas) — Image manipulation (cube faces, previews, thumbnails)
|
|
137
|
+
- [geolib](https://www.npmjs.com/package/geolib) — Geodesic bearing calculations
|
|
138
|
+
- [commander](https://www.npmjs.com/package/commander) — CLI argument parsing
|
|
139
|
+
- [xlsx](https://www.npmjs.com/package/xlsx) — Excel export
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
MIT
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 👨💻 Developer Card
|
|
148
|
+
|
|
149
|
+
<div align="center">
|
|
150
|
+
<img src="https://avatars.githubusercontent.com/u/47449165?v=4" alt="Younes M'rabti avatar" width="120" height="120" style="border-radius: 50%;" />
|
|
151
|
+
|
|
152
|
+
### Younes M'rabti
|
|
153
|
+
|
|
154
|
+
📧 Email: [admin@youmti.net](mailto:admin@youmti.net)
|
|
155
|
+
🌐 Website: [youmti.net](https://www.youmti.net/)
|
|
156
|
+
💼 LinkedIn: [younesmrabti1996](https://www.linkedin.com/in/younesmrabti1996/)
|
|
157
|
+
</div>
|
|
Binary file
|
package/assets/logo.jpg
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,27 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "krpanos-tools",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "CLI tools for processing equirectangular panoramic images: geotagging, cubemap face generation, and Excel metadata export",
|
|
5
5
|
"main": "src/equi.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"panos": "node src/equi -i static -o panos",
|
|
8
8
|
"grids": "node src/create-grid",
|
|
9
9
|
"build": "esbuild src/bin/assign_geodata.js src/bin/generate_excel.js src/bin/generate_faces.js --bundle --platform=node --outdir=dist --external:canvas",
|
|
10
|
+
"test": "jest --verbose",
|
|
10
11
|
"lint": "eslint .",
|
|
11
12
|
"lint:fix": "eslint . --fix"
|
|
12
13
|
},
|
|
14
|
+
"icon": "assets/logo.jpg",
|
|
13
15
|
"bin": {
|
|
14
16
|
"panos-geotag": "./dist/assign_geodata.js",
|
|
15
17
|
"panos-excel": "./dist/generate_excel.js",
|
|
16
18
|
"panos-faces": "./dist/generate_faces.js"
|
|
17
19
|
},
|
|
18
20
|
"files": [
|
|
19
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"INSTALL",
|
|
24
|
+
"assets",
|
|
25
|
+
"README.md"
|
|
20
26
|
],
|
|
21
|
-
"keywords": [
|
|
27
|
+
"keywords": [
|
|
28
|
+
"panorama",
|
|
29
|
+
"equirectangular",
|
|
30
|
+
"cubemap",
|
|
31
|
+
"360",
|
|
32
|
+
"geotag",
|
|
33
|
+
"exif",
|
|
34
|
+
"gps",
|
|
35
|
+
"krpano",
|
|
36
|
+
"tiles",
|
|
37
|
+
"cli"
|
|
38
|
+
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/youmtinet-krpano/equirectongular-to-tiles.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/youmtinet-krpano/equirectongular-to-tiles/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/youmtinet-krpano/equirectongular-to-tiles#readme",
|
|
22
47
|
"publisher": "YOUMTINET",
|
|
23
48
|
"author": "Younes Mrabti <admin@youmti.net>",
|
|
24
|
-
"license": "
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=16.0.0"
|
|
52
|
+
},
|
|
25
53
|
"dependencies": {
|
|
26
54
|
"canvas": "^2.11.2",
|
|
27
55
|
"commander": "^14.0.0",
|
|
@@ -43,8 +71,9 @@
|
|
|
43
71
|
"eslint-plugin-jest": "^28.5.0",
|
|
44
72
|
"eslint-plugin-prettier": "^5.1.3",
|
|
45
73
|
"eslint-plugin-security": "^3.0.0",
|
|
74
|
+
"jest": "^29.7.0",
|
|
46
75
|
"lint-staged": "^15.2.2",
|
|
47
76
|
"prettier": "^3.2.5"
|
|
48
77
|
},
|
|
49
78
|
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
|
|
50
|
-
}
|
|
79
|
+
}
|