Closed filipeamaldonado closed 9 months ago
eu tive um problema parecido com o arquivo, eu usei path.resolve e não tive mais problema com o arquivo
no inicio vc cria uma constante
const path = require('path')
e na hora de chamar o arquivo vc usa o resolve
const inputFile = path.resolve(__dirname, '..', 'content', `${sentenceIndex}-original.png[0]`)
const outputFile = path.resolve(__dirname, '..', 'content', `${sentenceIndex}-converted.png`)
@MatheusRV Resolvi isso agora no meu local. Acontece uma divergência por vezes do uso do CMD ou Git Bash que estou tentando resolver.
`(node:6699) UnhandledPromiseRejectionWarning: Error: Command failed: convert: unable to open image 'blur': No such file or directory @ error/blob.c/OpenBlob/3496.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562.
convert: unable to open image '0x9': No such file or directory @ error/blob.c/OpenBlob/3496.
convert: unable to open image '0x9': No such file or directory @ error/blob.c/OpenBlob/3496.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562.
convert: invalid argument for option '-resize': 1920x1080ˆ @ error/convert.c/ConvertImageCommand/2616.
at ChildProcess.onExit (/Users/*****/Bot-video-maker/node_modules/gm/lib/command.js:301:17)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:189:13)
at Pipe._handle.close (net.js:597:12)
(node:6699) 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: 1)
(node:6699) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
`
Fala galera, bele?
Estou fazendo o passo-a-passo da playlist e me deparei com esse erro quando é necessário tratar as imagens com o ImageMagick implementando o gm().
Algum de vocês passou por isso? Mesmo se n passou, alguma idéia do que possa ser?
Tentei a solução postada acima do path.resolve mas tbm não adiantou.
Agradeço desde já!
Utilizo MacOS com High Sierra 10.13.6 NPM 6.14.5 Node 10.15.3 ImageMagick 7.0.10-14 Q16 x86_64 2020-05-25
O seu erro ali é a falta de uma imagem no caminho do disco.
Acabei de ver em um outro Issue aberto aqui uma alternativa que troca o parâmetro 'convert' para 'magick', pois lendo o erro entendi que ele não reconhecia o blur e outras como uma operação válida. Alterei isso e aponta um erro na operação resize. Talvez eu esteja escrevendo errado algum argumento. Veja o erro:
(node:8270) UnhandledPromiseRejectionWarning: Error: Command failed: magick: unable to open image 'resize': No such file or directory @ error/blob.c/OpenBlob/3496.
magick: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562.
at ChildProcess.onExit (/Users/*****/Bot-video-maker/node_modules/gm/lib/command.js:301:17)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Socket.stream.socket.on (internal/child_process.js:389:11)
at Socket.emit (events.js:189:13)
at Pipe._handle.close (net.js:597:12)
(node:8270) 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: 1)
(node:8270) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Consegui.
Além de ir no diretório do GraphicMagick (...node_modules/gm/lib/index.js) e alterar o parâmetro conforme falei acima (dica postada aqui na Issue #110 no comentário: https://github.com/filipedeschamps/video-maker/issues/110#issuecomment-487408677 ) eu corrigi todo o trecho do código a partir da linha gm().
Obrigado pelo auxílio!
Fico feliz que tenha resolvido. Irei fechar o issue, caso necessário posso abrir novamente.
Quando executo o node está aparecendo o seguinte erro como retorno e já não sei mais o que fazer
Eu não consigo chegar nesse ponto do video de hoje, e avançar.
Eu uso: Ubuntu on Windows 1804.2018.817.0 NPM 6.9.0 Node.JS v8.10.0 ImageMagick 6.9.7-4 Q16 x86_64 20170114
O arquivo image.js que fiz