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

How to convert tiff to png with this API? #2

Open
yarafatin opened this issue Jan 29, 2015 · 4 comments
Open

How to convert tiff to png with this API? #2

yarafatin opened this issue Jan 29, 2015 · 4 comments

Comments

@yarafatin
Copy link

Could you please let me know if TIFF to PNG conversion is supported in this API? If so, what would be the command?

@manuels
Copy link
Owner

manuels commented Jan 29, 2015

Something like

var convert = new Interface('../convert-worker.js');
convert.on_stdout = function(txt) { console.log(txt); };

convert.on_stderr = function(txt) { console.log(txt); };
convert.addUrl('./src/config/magic.xml', '/usr/local/etc/ImageMagick/', true);
convert.addUrl('./src/config/coder.xml', '/usr/local/etc/ImageMagick/');
convert.addUrl('./src/config/policy.xml', '/usr/local/etc/ImageMagick/');
convert.addUrl('./src/config/english.xml', '/usr/local/etc/ImageMagick/');
convert.addUrl('./src/config/locale.xml', '/usr/local/etc/ImageMagick/');
convert.addUrl('./src/config/delegates.xml', '/usr/local/etc/ImageMagick/');
convert.addUrl('demo/test.tif', '/');
convert.allDone().then(function() {
    convert.run('demo/test.tif', '/test.png').then(function() {
        convert.getFile('/test.png').then(function(png) {
            console.log(png);
        });
    });
});

should do it

@yarafatin
Copy link
Author

I get this error -
"Magick: no decode delegate for this image format /test.tif' @ error/constitute.c/ReadImage/550. test.html:7 Magick: no images defined/test1.png' @ error/convert.c/ConvertImageCommand/3066."

I tried couple of tiff files with different compression levels and it gave the same error for all of them.

@manuels
Copy link
Owner

manuels commented Jan 29, 2015

please check if ./src/config/delegates.xml really exists

@yarafatin
Copy link
Author

Yes, it does. I see the delegate for tiff - "<delegate decode="tiff" encode="launch" mode...." in this file.

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

2 participants