Coder Social home page Coder Social logo

errors thrown for jpg image about optimizt HOT 14 CLOSED

funbox avatar funbox commented on May 11, 2024
errors thrown for jpg image

from optimizt.

Comments (14)

muralikodali avatar muralikodali commented on May 11, 2024 1

it works without errors.
Thanks again

from optimizt.

igoradamenko avatar igoradamenko commented on May 11, 2024

Hey!

Would you mind to attach the minimum set of files and the command you run to make it possible to reproduce the error?

Also, please, make sure you're using the latest version of Optimizt (2.4.0).

from optimizt.

muralikodali avatar muralikodali commented on May 11, 2024

I have already upgraded optimizt to 2.4.0

pictures attached as zip file

pics.zip

from optimizt.

343dev avatar 343dev commented on May 11, 2024

I have already upgraded optimizt to 2.4.0

pictures attached as zip file

pics.zip

Looks like the jpegoptim is not properly installed.

Maybe your OS lacks of required libs to build jpegoptim.
https://github.com/tjko/jpegoptim/blob/master/README#L5-L7.

In order to check this, you need to completely remove Optimizt, reinstall it and provide a log of the installation process.

from optimizt.

muralikodali avatar muralikodali commented on May 11, 2024

I am on arch linux. OS provided version of jpegoptim is 1.4.6.2
I have uninstalled OS version and compiled jpegoptim from github repository. but the error output is same.

I have uninstalled optimizt and after cleaning npm cache, i have reinstalled it again. same error repeats again.

log file showing installation process is attached for your reference :

install.log

from optimizt.

343dev avatar 343dev commented on May 11, 2024

Optimizt does not depend on system installed jpegoptim.

During the Optimizt installation process, the jpegoptim-bin package should run a postinstall script, which builds the jpegoptim from the source code.

An example of a successful Optimizt installation:

npm -g install @funboxteam/optimizt

/usr/bin/optimizt -> /usr/lib/node_modules/@funboxteam/optimizt/cli.js

> [email protected] install /usr/lib/node_modules/@funboxteam/optimizt/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /root/.npm/_libvips/libvips-8.10.5-linux-x64.tar.br

> [email protected] postinstall /usr/lib/node_modules/@funboxteam/optimizt/node_modules/gif2webp-bin
> node lib/install.js

  ✔ gif2webp pre-build test passed successfully

> [email protected] postinstall /usr/lib/node_modules/@funboxteam/optimizt/node_modules/gifsicle
> node lib/install.js

  ⚠ Response code 404 (Not Found)
  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✔ gifsicle built successfully

> [email protected] postinstall /usr/lib/node_modules/@funboxteam/optimizt/node_modules/guetzli
> node lib/install.js

  ⚠ Command failed: /usr/lib/node_modules/@funboxteam/optimizt/node_modules/guetzli/vendor/guetzli --verbose
Guetzli JPEG compressor. Usage:
guetzli [flags] input_filename output_filename

Flags:
  --verbose    - Print a verbose trace of all attempts to standard output.
  --quality Q  - Visual quality to aim for, expressed as a JPEG quality value.
  --memlimit M - Memory limit in MB. Guetzli will fail if unable to stay under
                 the limit. Default is 6000 MB
  --nomemlimit - Do not limit memory usage.


  ⚠ guetzli pre-build test failed
  ℹ compiling from source
  ✔ guetzli built successfully

> [email protected] postinstall /usr/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin
> node lib/install.js

  ⚠ Command failed: /usr/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim --version
/usr/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory


  ⚠ jpegoptim pre-build test failed
  ℹ compiling from source
  ✔ jpegoptim built successfully

> [email protected] postinstall /usr/lib/node_modules/@funboxteam/optimizt/node_modules/pngquant-bin
> node lib/install.js

  ✔ pngquant pre-build test passed successfully
+ @funboxteam/[email protected]
added 402 packages from 362 contributors in 71.283s

as you can see from the log, the postinstall script for jpegoptim-bin was run and jpegoptim was successfully built from source:

> [email protected] postinstall /usr/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin
> node lib/install.js

  ⚠ Command failed: /usr/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim --version
/usr/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory


  ⚠ jpegoptim pre-build test failed
  ℹ compiling from source
  ✔ jpegoptim built successfully

if the build fails, the log may look like this:

> [email protected] postinstall /home/xxx/.nvm/versions/node/v12.16.3/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin
> node lib/install.js

  ⚠ Command failed: /home/xxx/.nvm/versions/node/v12.16.3/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim --version
/home/xxx/.nvm/versions/node/v12.16.3/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory


  ⚠ jpegoptim pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c ./configure --prefix="/home/xxx/.nvm/versions/node/v12.16.3/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor" --bindir="/home/xxx/.nvm/versions/node/v12.16.3/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor"

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for jpeg_read_header in -ljpeg... no
Cannot find libjpeg or you have too old version (v6 or later required).

here we can see that it was not possible to build jpegoptim because of the libjpeg library is not found, so we can install libjpeg or libjpeg-turbo in our OS and start the Optimizt installation again.

The log you provided does not contain information about running postinstall scripts, so there is no way to conclude that jpegoptim was installed successfully or not.

Please make sure you don't have postinstall scripts disabled using ignore-scripts.

from optimizt.

343dev avatar 343dev commented on May 11, 2024

Error: spawn /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim ENOENT

Does the file really exist? If so, does it have permissions to run?
What happens if you try to run this file directly from terminal?

from optimizt.

muralikodali avatar muralikodali commented on May 11, 2024

/home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin/vendor/jpegoptim - this file doesn't exist.

/home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin
contains following file structure :

.
├── cli.js
├── index.js
├── lib
│   ├── index.js
│   └── install.js
├── license
├── package.json
└── readme.md

from optimizt.

343dev avatar 343dev commented on May 11, 2024

OK, now we know for sure that jpegoptim was not built from source during the Optimizt installation.

In order to understand why this happened, we need the postinstall script log like here: #9 (comment)

from optimizt.

muralikodali avatar muralikodali commented on May 11, 2024

libjpeg-turbo 2.0.6-1 was installed
I have provided complete log of installation. i don't know why post install scripts were not running ?

from optimizt.

343dev avatar 343dev commented on May 11, 2024

Please make sure you don't have postinstall scripts disabled using ignore-scripts.

Maybe you have ignore-scripts=true in your .npmrc file?

Please try this:

npm -g uninstall @funboxteam/optimizt
npm config set ignore-scripts false
npm -g install @funboxteam/optimizt

from optimizt.

muralikodali avatar muralikodali commented on May 11, 2024

Thanks for your suggestion.
I have built successfully with "npm config set ignore-scripts false".

log is produced as shown below :

/home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/bin/optimizt -> /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/cli.js

> [email protected] install /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /home/murali/.npm/_libvips/libvips-8.10.5-linux-x64.tar.br

> [email protected] postinstall /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/gif2webp-bin
> node lib/install.js

  ✔ gif2webp pre-build test passed successfully

> [email protected] postinstall /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/gifsicle
> node lib/install.js

  ⚠ Response code 404 (Not Found)
  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✔ gifsicle built successfully

> [email protected] postinstall /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/guetzli
> node lib/install.js

  ⚠ Command failed: /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/guetzli/vendor/guetzli --verbose
Guetzli JPEG compressor. Usage:
guetzli [flags] input_filename output_filename

Flags:
  --verbose    - Print a verbose trace of all attempts to standard output.
  --quality Q  - Visual quality to aim for, expressed as a JPEG quality value.
  --memlimit M - Memory limit in MB. Guetzli will fail if unable to stay under
                 the limit. Default is 6000 MB
  --nomemlimit - Do not limit memory usage.


  ⚠ guetzli pre-build test failed
  ℹ compiling from source
  ✔ guetzli built successfully

> [email protected] postinstall /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/jpegoptim-bin
> node lib/install.js

  ✔ jpegoptim pre-build test passed successfully

> [email protected] postinstall /home/zenova/projects/nvm/.nvm/versions/node/v12.9.1/lib/node_modules/@funboxteam/optimizt/node_modules/pngquant-bin
> node lib/install.js

  ✔ pngquant pre-build test passed successfully
+ @funboxteam/[email protected]
added 402 packages from 362 contributors in 52.679s

from optimizt.

343dev avatar 343dev commented on May 11, 2024

Good, i see no errors here. So i guess it works now?

from optimizt.

343dev avatar 343dev commented on May 11, 2024

You're welcome.

from optimizt.

Related Issues (18)

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.