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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu 16.10 mozjpeg pre-build test failed #244

Closed
ghost opened this issue Mar 27, 2017 · 5 comments
Closed

ubuntu 16.10 mozjpeg pre-build test failed #244

ghost opened this issue Mar 27, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Mar 27, 2017

ubuntu 16.10
npm install:

mozjpeg@4.1.1 postinstall /node_modules/mozjpeg
node lib/install.js

⚠ The node_modules/mozjpeg/vendor/cjpeg binary doesn't seem to work correctly
⚠ mozjpeg pre-build test failed
ℹ compiling from source
✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/node_modules/mozjpeg/vendor" --bindir="/node_modules/mozjpeg/vendor" --libdir="/node_modules/mozjpeg/vendor" && make --jobs=4 && make install --jobs=4
Command failed: ./configure --disable-shared --prefix="/node_modules/mozjpeg/vendor" --bindir="/node_modules/mozjpeg/vendor" --libdir="/node_modules/mozjpeg/vendor"
configure: error: no nasm (Netwide Assembler) found

at ChildProcess.exithandler (child_process.js:204:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
@kornelski
Copy link
Member

The message says you don't have nasm installed. Install nasm.

@ghost
Copy link
Author

ghost commented Mar 27, 2017

Resolved thanks!
Thanks for your response!

@ghost ghost closed this as completed Mar 27, 2017
xinyu391 pushed a commit to xinyu391/mozjpeg that referenced this issue Sep 25, 2018
Fixes NULL pointer reference when decompressing 4:2:2 or 4:2:0 JPEG
images with cinfo.do_fancy_upsampling = FALSE.

Closes mozilla#244
kornelski pushed a commit that referenced this issue Jan 22, 2021
The additional segfault mentioned in #244 was due to the fact that
the merged upsamplers use a different private structure than the
non-merged upsamplers.  jpeg_skip_scanlines() was assuming the latter, so
when merged upsampling was enabled, jpeg_skip_scanlines() clobbered one
of the IDCT method pointers in the merged upsampler's private structure.

For reasons unknown, the test image in #441 did not encounter this
segfault (too small?), but it encountered an issue similar to the one
fixed in 5bc43c7, whereby it was
necessary to set up a dummy postprocessing function in
read_and_discard_scanlines() when merged upsampling was enabled.
Failing to do so caused either a segfault in merged_2v_upsample() (due
to a NULL pointer being passed to jcopy_sample_rows()) or an error
("Corrupt JPEG data: premature end of data segment"), depending on the
number of scanlines skipped and whether the first scanline skipped was
an odd- or even-numbered row.

Fixes #441
Fixes #244 (for real this time)
kornelski pushed a commit that referenced this issue Jan 22, 2021
- Introduce a partial image decompression regression test script that
  validates the correctness of jpeg_skip_scanlines() and
  jpeg_crop_scanlines() for a variety of cropping regions and libjpeg
  settings.

  This regression test catches the following issues:
  #182, fixed in 5bc43c7
  #237, fixed in 6e95c08649794f5018608f37250026a45ead2db8
  #244, fixed in 398c1e9
  #441, fully fixed in this commit

  It does not catch the following issues:
  #194, fixed in 773040f
  #244 (additional segfault), fixed in
       9120a24

- Modify the libjpeg-turbo regression test suite (make test) so that it
  checks for the issue reported in #441 (segfault in
  jpeg_skip_scanlines() when used with 4:2:0 merged upsampling/color
  conversion.)

- Fix issues in jpeg_skip_scanlines() that caused incorrect output with
  h2v2 (4:2:0) merged upsampling/color conversion.  The previous commit
  fixed the segfault reported in #441, but that was a symptom of a
  larger problem.  Because merged 4:2:0 upsampling uses a "spare row"
  buffer, it is necessary to allow the upsampler to run when skipping
  rows (fancy 4:2:0 upsampling, which uses context rows, also requires
  this.)  Otherwise, if skipping starts at an odd-numbered row, the
  output image will be incorrect.

- Throw an error if jpeg_skip_scanlines() is called with two-pass color
  quantization enabled.  With two-pass color quantization, the first
  pass occurs within jpeg_start_decompress(), so subsequent calls to
  jpeg_skip_scanlines() interfere with the multipass state and prevent
  the second pass from occurring during subsequent calls to
  jpeg_read_scanlines().
@Fredkiss3
Copy link

The message says you don't have nasm installed. Install nasm.

How do i install nasm ?

@kornelski
Copy link
Member

It depends on your platform. If you're on Linux, there's probably nasm package for the package-manager of your distro. See also https://www.nasm.us

@yongyiwong
Copy link

when I install mozjpeg globally and mozjepg --help, I got this error.
Environment: Ubuntu 22.04.1 LTS
Node version: 14.20.0

Here is the command I tried.

npm -g install mozjpeg
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
/home/gf/.nvm/versions/node/v14.20.0/bin/mozjpeg -> /home/gf/.nvm/versions/node/v14.20.0/lib/node_modules/mozjpeg/cli.js

> mozjpeg@8.0.0 postinstall /home/gf/.nvm/versions/node/v14.20.0/lib/node_modules/mozjpeg
> node lib/install.js

+ mozjpeg@8.0.0
added 163 packages from 52 contributors in 49.827s
mozjpeg --help

events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: spawn /home/gf/.nvm/versions/node/v14.20.0/lib/node_modules/mozjpeg/vendor/cjpeg ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:19)
    at onErrorNT (internal/child_process.js:472:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:12)
    at onErrorNT (internal/child_process.js:472:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /home/gf/.nvm/versions/node/v14.20.0/lib/node_modules/mozjpeg/vendor/cjpeg',
  path: '/home/gf/.nvm/versions/node/v14.20.0/lib/node_modules/mozjpeg/vendor/cjpeg',
  spawnargs: [ '--help' ]
}

Actually when post install, I don't get any error or message.
Also I have installed all packages automake autoconf libtool dpkg pkgconfig nasm libpng

Is there anyone faced this issue?

Thanks.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants