Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: add tiled Buffer (and Stream) output #2238

Closed
lovell opened this issue Jun 3, 2020 · 6 comments
Closed

Enhancement: add tiled Buffer (and Stream) output #2238

lovell opened this issue Jun 3, 2020 · 6 comments

Comments

@lovell
Copy link
Owner

lovell commented Jun 3, 2020

Will use vips_dzsave_buffer, forces container property to have a value of "zip".

Requires exposing the basename property (libvips default is "undefined").

馃憞 PROPOSED API - NOT YET AVAILABLE available in v0.31.0

const zipFileWithTiles = await sharp(input)
  .tile({ basename: "tiles" })
  .toBuffer();
const iiififier = sharp().tile({ layout: "iiif" });

readableStream
  .pipe(iiififier)
  .pipe(writeableStream);

鈽濓笍 PROPOSED API

@Talbot3
Copy link

Talbot3 commented Aug 18, 2020

Thank your tips.here is my code that run pass.

const img = require('sharp');
const fs = require('fs');
const imgStream = img().tile().toFormat('jpg').resize(320, 240);
console.log(imgStream.format)
const path = require('path');
let rStream = fs.createReadStream(path.join(__dirname, 'test.jpg').toString());
let wStream = fs.createWriteStream('./test.haha.jpg');
rStream.pipe(imgStream).pipe(wStream);

@lovell
Copy link
Owner Author

lovell commented Aug 18, 2020

@Talbot3 This future possible enhancement is about Streaming a zip file containing multiple tile-based deep zoom (image pyramid) images with complete directory structure. The use of toFormat('jpg') in your sample code means it will only output one image.

@nikolay-atypon

This comment was marked as off-topic.

@manfwh

This comment was marked as off-topic.

@lovell
Copy link
Owner Author

lovell commented Jul 24, 2022

Commit b46ab51 adds support for tile output via Stream and Buffer. This will be in v0.31.0.

@lovell lovell added this to the v0.31.0 milestone Jul 24, 2022
@lovell
Copy link
Owner Author

lovell commented Sep 5, 2022

v0.31.0 now available with this improvement.

@lovell lovell closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants