Comments (4)
Also as extra information I currently have another implementation on a different server using v2 that works fine, as mentioned before running v3 locally also works. I'm really what to do to debug this, I'm not getting any error so really hard to know what's causing it not to render the images. For completeness here's my code
exports.createSvg = function(item_id, svg) {
var timestamp = Date.now();
var svg_path = 'uploads/items/' + item_id + '.svg';
var png_path = 'uploads/items/' + item_id + '_' + timestamp + '.png';
var svg_buffer = new Buffer(svg);
var s3 = new AWS.S3();
var params = {
Bucket: sails.config.aws.bucket,
Key: svg_path,
ACL: 'public-read',
Body: svg,
ContentType: 'image/svg+xml'
};
var putObjectPromise = s3.putObject(params).promise();
return putObjectPromise.then(function(data) {
return svg2png(svg_buffer, {
width: 600
});
}).then(function(data) {
var params = {
Bucket: sails.config.aws.bucket,
Key: png_path,
Body: data,
ContentType: 'image/png'
};
var putObjectPromise = s3.putObject(params).promise();
return putObjectPromise;
}).then(function(resp) {
return LineItem.update(item_id, {
svg_path: svg_path,
png_path: png_path
});
}).catch(function(err) {
console.error(err);
reject(err);
});
};
from svg2png.
Hmm. I was not able to reproduce this locally. If I sent that file through as a string directly (e.g. using Buffer.from(
...svg here...)
the result looks correct.
Could you create a reproduction case that I could run on my own computer, not involving S3 or servers or anything?
from svg2png.
Unfortunately the problem only occurs on the version uploaded to the server, and only thing I can think of is that the images stored in cloundinary and referenced in the defs are not loading, but this shouldn't be the case as there are no restrictions on being able to access those images.
from svg2png.
Maybe your server has a firewall preventing outbound connections or similar.
Going to close since this isn't really actionable for me since I have no way of reproducing and debugging it :(.
from svg2png.
Related Issues (20)
- nothing happens when running on MS Azure
- Erro when use svg2png in docker container HOT 6
- Request for custom PhantomJS path
- sgv2png failing to work after macOS High Sierra upgrade HOT 2
- SVG with mix-blend-mode not working as expected HOT 1
- Hide Phantomjs.exe command window on Windows HOT 1
- Brackets appearing in output from XML tag HOT 1
- Scale in versions > 2.1.0
- Indirect dependency on [email protected] HOT 1
- Plans to remove PhantomJS dependency HOT 1
- Memory Error when dealing with SVGs that are about 150 MB
- `svg2png.sync()` raise exception on only windows. HOT 2
- Change license
- not working to phantomjs execute in electron release package on macosx Catalina
- SSRF and Server Side XSS HOT 3
- Update dependency "yargs" HOT 3
- Output image being cropped
- add background colour option
- Problem with feGaussianBlur filter
- Support for ARM/Apple silicon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg2png.