Comments (7)
@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.
@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.
@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.
@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.
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.
Great stuff! Glad we could help 😄
from imagesharp.web.
@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)
- DirectoryNotFoundException: ... \wwwroot\ for Azure blob storage provider HOT 4
- How to prevent rotation based on Exif Orientation HOT 1
- WebP images don't auto orient based on EXIF metadata HOT 16
- AWS S3 Transfert Acceleration HOT 1
- v1.0.5 unsupported format prevents all processing HOT 2
- Add Custom Parameter to the request url for caching HOT 2
- 2.0.0 Breaks on filenames with special characters HOT 2
- Middleware is very susceptible to unreasonable processing commands HOT 1
- ImageSharp Web does not appear to handle rotation during format change to WEBP HOT 4
- Unable to access SixLabors.ImageSharp.Web.Caching.Azure namespace HOT 2
- Link to license in GitHub README returns 404
- OnBeforeSaveAsync called only when there are available Commands which is not correct in some scenarios
- Azure middleware trows an exception in 3.0+ version HOT 16
- Image caching does not differentiate between different query strings HOT 1
- Confusing 500 error with width (or height) querystring - Umbraco thumbnails HOT 2
- Major CPU performance decrease with ImageSharp.Web 3 HOT 20
- "Sending image. Request uri" log Should be debug not information HOT 2
- Formatting an image to webp is losing some of the transparency in the image
- Open Snyk Issue with high severity for several months HOT 2
- WebP encoding not honouring the Exif orientation data? HOT 3
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 imagesharp.web.