nodeca / probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
MIT License
979 stars 77 forks source link

UnhandledPromiseRejectionWarning: Error: Invalid URI when i try to pass a local server image url to probe #30

Closed tejasspublishers closed 5 years ago

tejasspublishers commented 5 years ago

http:\localhost:3000\api\uploads\5c8e8d81e51b0f3c7409b662\staffs-avatar\9qAnpXFHAOmAaQ9QKUG5tudJzGMk2KCi.jpg (node:18724) UnhandledPromiseRejectionWarning: Error: Invalid URI "http:/localhost:3000/api/uploads/5c8e8d81e51b0f3c7409b662/staffs-avatar/9qAnpXFHAOmAaQ9QKUG5tudJzGMk2KCi.jpg" at Request.init (C:\tution\backend-service-nodejs-mongodb\node_modules\request\request.js:273:31) at new Request (C:\tution\backend-service-nodejs-mongodb\node_modules\request\request.js:127:8) at request (C:\tution\backend-service-nodejs-mongodb\node_modules\request\index.js:53:10) at C:\tution\backend-service-nodejs-mongodb\node_modules\probe-image-size\http.js:31:13 at new Promise () at probeHttp (C:\tution\backend-service-nodejs-mongodb\node_modules\probe-image-size\http.js:27:10) at get_image_size (C:\tution\backend-service-nodejs-mongodb\node_modules\probe-image-size\index.js:42:25) at Promise.all.subdirs.map (C:\tution\backend-service-nodejs-mongodb\src\routes\staffs.js:64:13) at Array.map () at getFiles (C:\tution\backend-service-nodejs-mongodb\src\routes\staffs.js:58:17) (node:18724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

puzrin commented 5 years ago

As message says, passed param is invalid. Wrong slashes + missed one after http.