Git Product home page Git Product logo

Comments (4)

dottodot avatar dottodot commented on July 17, 2024

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.

domenic avatar domenic commented on July 17, 2024

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.

dottodot avatar dottodot commented on July 17, 2024

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.

domenic avatar domenic commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.