Sharp: Is it possible to get length/width parameters of the image before processing it?

Created on 9 Apr 2017  路  4Comments  路  Source: lovell/sharp

Hi - I need image length and width parameters before processing. Is it possible to get them via sharp package? I couldn't find anything in documentation on this.

Thanks!
Andriy

question

Most helpful comment

Hello, the metadata operation is probably what you need.

All 4 comments

Hello, the metadata operation is probably what you need.

Closing as I assume #785 indicates progress.

hey @lovell I'm not sure what just happened, but I believe the link in the "metadata" comment from April 9, 2017 is a bad URL that, after redirecting several times to the IP address "138.68.59.48", downloads a scary-looking HTML file... for reference, the linked URL is "http:// sharp.dimens.io /en/stable/api-input/#metadata" (adding spaces in URL to prevent accidental clicks)

  1. Do you have any idea what that is (and if those who clicked should be worried lol)?
  2. Is there any way to adjust the linked URL so that anyone googling "node sharp resize image" doesn't make the same mistake?

Edit: I'm guessing the downloaded file is an attempt to scare people into clicking it, opening it in their default browser, rendering something designed to again scare people into doing something dumb... but in the end it's just an HTML file and nothing has happened...?

@michaellosurdo Thanks, have updated, please see #2132 for context.

Was this page helpful?
0 / 5 - 0 ratings