Git Product home page Git Product logo

mozjpegsharp's People

Contributors

aseemgautam avatar dependabot-preview[bot] avatar dependabot[bot] avatar georg-jung avatar qmfrederik avatar sergey-terekhin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vrmars3d

mozjpegsharp's Issues

Create a small application

Using your own code, you could make a very useful application. It shoud be given a path and it shoul iterate over all files in tis directory and the sub direcories. It should do the safest thing i.e. make the jpg smaller such that is pixel by pixel identical. When a jpg is found, let mozjpeg create something like jpg.tmp. If this file is smaller, the original file can be overwritten by the contents of jpg.tmp. Either way, jpg.tmp shpuld be deleted afterwards. This is better than deleting the original file and then renaming jpg.tmp since it will cause fragmentation. Most jpg files from your smartcam can be reduced by 6% or so and most people have folders with lots of jpeg files.

Best regards,
Fredrik

Sample code no longer compiles under Version 2.1.12

The sample code provided on the code page https://github.com/georg-jung/MozJpegSharp no longer compiles.

This line
var compressed = tjc.Compress(bmp, MozJpegSharp.TJSubsamplingOption.Chrominance420, 75, MozJpegSharp.TJFlags.None);
reports:
Severity Code Description Project File Line Suppression State
Error CS1501 No overload for method 'Compress' takes 4 arguments

Can you provide an updated base sample please :)

UnmanagedLibrary = "turbojpeg"

Hi there,
I'm hoping this is a very silly question and I've missed something basic, but I was running through the code and spotted this:

public const string UnmanagedLibrary = "turbojpeg";

I was expecting this to be "mozjpeg" as opposed to the "turbojpeg" in Quamotion.TurboJpegWrapper.

I assume you're shipping the MozJpeg dll with nuget but just never renamed this in code / the nuget package generation steps?

Provided pixel format "8207" is not supported

This call tjc.Compress(bmp, MozJpegSharp.TJSubsamplingOption.Chrominance420, 75, MozJpegSharp.TJFlags.None);

Is giving an exception

Provided pixel format "8207" is not supported

Is there anything I can do to shrink these? Squoosh will shrink them fine.

Thanks

Pixelation when under .netcore linux

I am running into pixilation issue when using MozJpegSharp from within docker deployment via standard MS template which is Debian.

When running compression from within VS on windows - results are good. However after deploying the same code to Docker, compressing any image appears to cause fairly noticeable pixilation.

I've tried changing parameters, but the results are the same.

Windows:
test_thumb_win

Linux:
test_thumb_lin

Source file:
test

Any suggestions appreciated.

Encoding with (F#):

let writeMozJpg (img:System.Drawing.Image) path =
        async {
            use bmp = new System.Drawing.Bitmap(img)
            use tjc = new MozJpegSharp.TJCompressor();
            let compressedBytes = tjc.Compress(bmp, MozJpegSharp.TJSubsamplingOption.Chrominance420, 75, MozJpegSharp.TJFlags.AccurateDct)

            if compressedBytes.Length > 0 then
                use file = File.Create(path)
                do! file.AsyncWrite(compressedBytes,0,compressedBytes.Length)
                file.Close()
                return (true, path)
            else
                return (false, String.Empty)
        }

Dockerfile:

FROM mcr.microsoft.com/dotnet/aspnet:5.0
EXPOSE 8181

RUN apt update
RUN apt install -y libgdiplus
RUN apt install -y libturbojpeg0

COPY bin/Release/net5.0/publish/ App/
WORKDIR /App
ENTRYPOINT ["dotnet", "matter.App.dll", "appsettings.json"]

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.