GithubHelp home page GithubHelp logo

niteshkumar7 / aspnetcoreimageresizingservice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmitrysikorsky/aspnetcoreimageresizingservice

0.0 0.0 0.0 1.13 MB

ASP.NET Core sample image resizing service

License: Other

C# 100.00%

aspnetcoreimageresizingservice's Introduction

ASP.NET Core Sample Image Resizing Service

This is a demo web application for the “ASP.NET Core Sample Image Resizing Service” post on the Dmitry Sikorsky’s blog. It demonstrates how to build image resizing service on ASP.NET Core using the CoreCompat.System.Drawing package for the image processing.

It downloads an image specified by the URL, crops it using the parameters (provided in the URL too), and writes the cropped image into the output stream.

This is the original photo of my cat: Original photo of my cat Original photo of my cat

This is the URL used to crop the photo: http://localhost:60233/image?url=http://sikorsky.pro/images/my_cat.jpg&sourcex=240&sourcey=240&sourcewidth=360&sourceheight=360&destinationwidth=200&destinationheight=200

And this is the cropped photo: Cropped photo of my cat Cropped photo of my cat

Usually I use something like this to prepare images for the mobile devices depending on their real screen resolutions and image container sizes. This allows to save the traffic and image downloading time. Also, it makes images look better because they don’t need any scaling.

Updated to use .NET Core 3.1.

Using the Application

  1. Run the application.
  2. You will have 404 error and it is OK.
  3. Navigate to http://localhost:60233/image?url=http://some-image-url&sourcex=0&sourcey=0&sourcewidth=100&sourceheight=100&destinationwidth=100&destinationheight=100.
  4. You will get 100x100 fragment from the given image.

aspnetcoreimageresizingservice's People

Contributors

dmitrysikorsky avatar

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.