Skip to content

Commit 5b2f65a

Browse files
committed
fixes for local hosting
1 parent 2889bbe commit 5b2f65a

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

camamokjs/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,12 @@ The server can also be started from the Lightleaks docker image by running
1313
```
1414
bin/camamok
1515
```
16+
17+
## Running without Docker
18+
19+
```
20+
nvm install 14
21+
nvm use 14
22+
npm install
23+
npm run dev
24+
```

camamokjs/src/CameraTriggerApp.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
3232
export const preferences = writable("camtriggerpreferences_v3", {
3333
cameraUrl: "http://192.168.1.2:8080",
34-
proCamScanUrl: "http://host.docker.internal:8000",
34+
proCamScanUrl: "http://localhost:8000", // should be host.docker.internal if running inside docker
3535
shutterSpeed: 0,
3636
captureDuration: 0,
3737
});
@@ -516,7 +516,7 @@
516516
</div>
517517
</div>
518518
<div class="panel-row">
519-
<div class="box"><img style="max-width: 100%" src={previewSrc} /></div>
519+
<div class="box"><img style="max-width: 100%" src={previewSrc} alt="preview" /></div>
520520
</div>
521521
</div>
522522

python/src/imutil.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ def imwrite(filename, img):
7070
if len(img.shape) == 2:
7171
return cv2.imwrite(filename, img)
7272
if len(img.shape) == 3:
73-
if img.shape[-1] == 3:
73+
if img.shape[-1] == 1:
74+
return cv2.imwrite(filename, img[:,:,0])
75+
elif img.shape[-1] == 3:
7476
return cv2.imwrite(filename, img[...,::-1])
75-
if img.shape[-1] == 4:
77+
elif img.shape[-1] == 4:
7678
return cv2.imwrite(filename, img[...,(2,1,0,3)])
7779
else:
78-
raise Exception('Unsupported number of channels')
80+
raise Exception('Unsupported number of channels for shape', img.shape)
7981
else:
80-
raise Exception('Unsupported image shape')
82+
raise Exception('Unsupported image shape', img.shape)
8183

8284
def downsample(img, scale=None, output_wh=None, max_side=None, min_side=None, block_size=None, mode=None):
8385
if max_side is not None:

0 commit comments

Comments
 (0)