Giter Site home page Giter Site logo

gulp-sharp-optimize-images's People

Contributors

ulyanov-programmer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hassinechebil

gulp-sharp-optimize-images's Issues

ERR_REQUIRE_ESM

hi

i wanted to try your lib but i get

 Requiring external module @babel/register
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\laragon\www\florarie\node_modules\gulp-sharp-optimize-images\index.js from D:\laragon\www\florarie\task-runners\images.js not supported.
Instead change the require of index.js in D:\laragon\www\florarie\task-runners\images.js to a dynamic import() which is available in all CommonJS modules.
    at Object.newLoader [as .js] (D:\laragon\www\florarie\node_modules\pirates\lib\index.js:141:7)
    at Object.<anonymous> (D:\laragon\www\florarie\task-runners\images.js:11:27)
    at Module._compile (D:\laragon\www\florarie\node_modules\pirates\lib\index.js:136:24)
    at Object.newLoader [as .js] (D:\laragon\www\florarie\node_modules\pirates\lib\index.js:141:7)
    at requireDir (D:\laragon\www\florarie\node_modules\require-dir\index.js:128:33)
    at Object.<anonymous> (D:\laragon\www\florarie\gulpfile.babel.js:40:1)
    at Module._compile (D:\laragon\www\florarie\node_modules\pirates\lib\index.js:136:24)
    at Object.newLoader [as .js] (D:\laragon\www\florarie\node_modules\pirates\lib\index.js:141:7)
    at async Promise.all (index 0) {
  code: 'ERR_REQUIRE_ESM'

any idea what i can do to solve this ?

Broken file paths when build via GitHub Actions

Description

Hello.

When I automatically built and deploy my project on GitHub Pages using GitHub Actions (github-pages-deploy-action), I discovered that this library was generating incorrect file paths for images. The generated paths contained an escaped backslash as a separator between the filename and base path, which seems to be handled incorrectly on Linux. This results in filenames being generated with the base path included (see screenshot).

Screenshots

github

Files

Comments

I suspect the culprit might be line 103, where the full file path is being created. Perhaps the fix could be as simple as replacing the escaped backslash with a single slash (/). Though I don't know for sure :)

let newFilePath = `${file.dirname}/${newFileName}`

Not compatible with gulp v5?

After upgrading to [email protected] I get the following traceback while using gulp-sharp-optimize-images:

[11:12:29] Error: Input buffer contains unsupported image format
    at Sharp.toBuffer (D:\Workspace\egu\node_modules\sharp\lib\output.js:161:17)
    at convert (file:///D:/Workspace/egu/node_modules/gulp-sharp-optimize-images/index.js:86:38)
    at Transform._transform (file:///D:/Workspace/egu/node_modules/gulp-sharp-optimize-images/index.js:68:25)
    at Transform._read (D:\Workspace\egu\node_modules\gulp-sharp-optimize-images\node_modules\readable-stream\lib\_stream_transform.js:166:10)
    at Transform._write (D:\Workspace\egu\node_modules\gulp-sharp-optimize-images\node_modules\readable-stream\lib\_stream_transform.js:155:83)
    at doWrite (D:\Workspace\egu\node_modules\gulp-sharp-optimize-images\node_modules\readable-stream\lib\_stream_writable.js:390:139)
    at writeOrBuffer (D:\Workspace\egu\node_modules\gulp-sharp-optimize-images\node_modules\readable-stream\lib\_stream_writable.js:381:5)
    at Transform.Writable.write (D:\Workspace\egu\node_modules\gulp-sharp-optimize-images\node_modules\readable-stream\lib\_stream_writable.js:302:11)
    at Transform.ondata (node:internal/streams/readable:1007:22)
    at Transform.emit (node:events:518:28)
    at Transform.emit (node:domain:551:15)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushObjectMode (node:internal/streams/readable:536:3)
    at Transform.Readable.push (node:internal/streams/readable:391:5)
    at node:internal/streams/transform:178:12
    at file:///D:/Workspace/egu/node_modules/easy-transform-stream/index.js:18:7
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

After downgrading to [email protected] it works again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.