https://github.com/image-js/image-dataset-demo
https://github.com/image-js/image-dataset-demo
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/image-js/image-dataset-demo
- Owner: image-js
- Created: 2023-06-16T09:18:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-07T14:43:10.000Z (about 2 years ago)
- Last Synced: 2025-03-24T04:48:13.357Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://image-js.github.io/image-dataset-demo/
- Size: 59.2 MB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Adding more images
Add the images in a folder in docs
Create the toc file using: `node src/buildToc.mjs`
## Demo files
Files are available at the following URL https://image-js.github.io/image-dataset-demo/
It is possible to load all the files at once using 'file-collection'
```js
const url = 'https://image-js.github.io/image-dataset-demo/';
const fileCollection = new FileCollection();
await fileCollection.appendWebSource(url);
```
There is a 'toc' file that could be placed in a menu:
- https://image-js.github.io/image-dataset-demo/toc.json
This toc file contains 'source' that could be a props of a react component.
```js
import { FileCollection } from 'file-collection';
const source = {
baseURL: 'https://image-js.github.io/image-dataset-demo/',
entries: [
{
relativePath: 'cats/cats-eyes-2944820_1280.jpg',
},
],
};
const fileCollection = new FileCollection();
await fileCollection.appendSource(source);
const files = [...fileCollection];
const arrayBuffer = await files[0].arrayBuffer();
console.log(files);
console.log(arrayBuffer.byteLength);
```