Giter Site home page Giter Site logo

Comments (7)

tocsoft avatar tocsoft commented on August 23, 2024 2

@Squalex1496 ImageSharp and thus ImageSharp.Web doesn't have any support for svg. You normally wouldn't want to resize/rasterize svgs server side as that would defeat the purpose of them being scalable graphics, you would normally want to alter them via css directly as it will produce the best results.

from imagesharp.web.

Squalex1496 avatar Squalex1496 commented on August 23, 2024 2

@JimBobSquarePants & @andymac4182 yes that was exactly the problem, all i needed to change was the order. Tested it out and its working great! I've started integrating this inf a Nop Commerce project and I think that its the perfect tool for anyone that needs the processing done on their images for the site, great work and many thanks!

from imagesharp.web.

andymac4182 avatar andymac4182 commented on August 23, 2024 1

@Squalex1496 Are you able to publish the code to a repo? My guess would be an ordering issue in Startup. I had a similar issue when I did the ordering wrong.

from imagesharp.web.

Squalex1496 avatar Squalex1496 commented on August 23, 2024

@tocsoft thanks for replying and about the SVG noted, however the problem still arose when i used any other image format, example <img src="images/drill-1.jpg?width=300&height=600" alt="img"/> the image remains exactly the same and no processing has been done to it whatsoever. I've followed the guidelines to the letter but maybe i've missed something?

P.S.
I'm testing it out on a fresh .Net Core 2.0 Template with nothing else added or featured, i intend to implemente this in a Nop Commerce project. I think that the ImageSharp.Web would make managing images for the client much easier. Thanks.

from imagesharp.web.

JimBobSquarePants avatar JimBobSquarePants commented on August 23, 2024

Good point @andymac4182 Ordering is important. We have to be declare before the static file middleware for example.

@Squalex1496 There's a sample application within the repository which has example setup for pretty much every scenario. In your case (without additional configuration) your startup file should look something like this.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using SixLabors.ImageSharp.Web.DependencyInjection;

namespace SixLabors.ImageSharp.Web.Sample
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            // Add the default service and options.
            services.AddImageSharp();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole();

            app.UseExceptionHandler();
            app.UseDeveloperExceptionPage();
            app.UseDefaultFiles();
            app.UseImageSharp();
            app.UseStaticFiles();
        }
    }
}

from imagesharp.web.

JimBobSquarePants avatar JimBobSquarePants commented on August 23, 2024

Great stuff! Glad we could help 😄

from imagesharp.web.

untiedshoes avatar untiedshoes commented on August 23, 2024

@Squalex1496 yes that was exactly the problem, all i needed to change was the order. Tested it out and its working great! I've started integrating this into a NopCommerce project and I think that its the perfect tool for anyone that needs the processing done on their images for the site, great work and many thanks!

I know this was a way back now, but any chance you could give some insights into how you incorporated imageSharp.Web into nopCommerce (4.00) - I'm having the same issue at the moment, and for the life of me, can I not get it working!

Regards,
Craig

from imagesharp.web.

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.