Patch:add hint for input image size#103
Patch:add hint for input image size#103zizon wants to merge 1 commit intoelad:masterfrom zizon:hint-size
Conversation
for some image format like SVG which may contains no size info. without the size hint,convert to other format will fail. this patch try to resolve this issue.
|
Why did you close it? I'm sorry I didn't get to it, but nobody has commented on it. Is it working? Could you please provide updates to the readme file and examples too? |
|
@elad here is a sample I encountered. 'use strict';
var fs = require('fs');
var imagemagick = require('imagemagick-native');
fs.writeFileSync('after.png',
imagemagick.convert({
srcData: new Buffer('<svg style="width: 65.7px; height: 23.4px; background: transparent;"><path style="border: 0px; fill: rgb(230, 124, 115);" d="M 0 0 L 0 0 L 65.7 0 L 65.7 23.4 L 0 23.4 Z" transform="translate(0 0)"></path></svg>'),
format: 'PNG',
srcFormat : 'SVG',
},
function(err,buffer){
if(err){
console.error(err.stack);
}
console.error(buffer);
}
)
);this will made ImageMagick cry with something like this is cause by this. recall sample SVG above,it has no viewbox attributes for its svg element. so basically speaking,it is a misuse. my fault. lastly, as a minor suggestion, |
|
It's okay, no bother at all! All PRs are welcome, even those that turn out to not be necessary...
Sounds like a necessary PR, how about you file one? ;) |
|
fire a new PR. as simple as adding another compiler flag to enable/force RTTI generation. On Sat, May 14, 2016 at 5:27 AM, Elad Efrat notifications@github.com
|
for some image format like SVG which may contains no size info.
without the size hint,convert to other format will fail.
this patch try to resolve this issue.