GithubHelp home page GithubHelp logo

Comments (5)

Guest126 avatar Guest126 commented on June 20, 2024 2

Let me explain what i did.

First, I followed the pngquant Installation instructions and installed Rust and Visual Studio 2019 on Windows 10.

Clone the msvc branch for Windows from the repository.

> git clone -b msvc --recursive https://github.com/kornelski/pngquant.git
Cloning into 'pngquant'...
remote: Enumerating objects: 4746, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 4746 (delta 28), reused 38 (delta 16), pack-reused 4687
Receiving objects: 100% (4746/4746), 1.76 MiB | 2.80 MiB/s, done.
Resolving deltas: 100% (3121/3121), done.
Submodule 'lib' (https://github.com/ImageOptim/libimagequant.git) registered for path 'lib'
Cloning into 'C:/[censored]/pngquant/lib'...
remote: Enumerating objects: 4277, done.
remote: Counting objects: 100% (152/152), done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 4277 (delta 75), reused 114 (delta 55), pack-reused 4125
Receiving objects: 100% (4277/4277), 898.74 KiB | 7.19 MiB/s, done.
Resolving deltas: 100% (2803/2803), done.
Submodule path 'lib': checked out 'f41ee301ff3a407b16991af3dbe03910919bbdc3'

Build.

> cd pngquant
> cargo build --release
    Updating crates.io index
   Compiling jobserver v0.1.24
   Compiling pkg-config v0.3.22
   Compiling dunce v1.0.2
   Compiling vcpkg v0.2.15
   Compiling libc v0.2.106
   Compiling bytemuck v1.7.2
   Compiling unicode-width v0.1.9
   Compiling glob v0.3.0
   Compiling bitflags v1.3.2
   Compiling cc v1.0.71
   Compiling rgb v0.8.29
   Compiling getopts v0.2.21
   Compiling wild v2.0.4
   Compiling libz-sys v1.1.3
   Compiling imagequant-sys v3.1.0+sys2.16.0 (C:\[censored]\pngquant\lib)
   Compiling libpng-sys v1.1.8
   Compiling lcms2-sys v3.1.9
   Compiling pngquant v2.16.0 (C:\[censored]\pngquant)
warning: msvc-dist/ directory not present. MSVC builds may fail
    Finished release [optimized] target(s) in 23.51s

The executable binary 2.16.0 is compiled. But, this had a issue #376 that have been fixed in 2.15.0.

\pngquant> target/release/pngquant.exe "イメージ.png"
  error: cannot open 繧、繝。繝シ繧ク.png for reading

The file containing Japanese cannot be opened and the file name is garbled. why?

GustJc said,

// Inside static pngquant_error read_image
setlocale(LC_ALL, ".65001");

Although, b4d77c7 added setlocale() inside the main() function instead of the read_image() function.

In addition, it looks that the main() function is not compiled by the preprocessor.

#ifndef PNGQUANT_NO_MAIN
int main(int argc, char *argv[])

So setlocale() wasn't working. I don't understand the reason for doing this.

There is a compile switch in rust/build.rs.

cc.define("PNGQUANT_NO_MAIN", Some("1"));

When I commented out this line, I got some compilation errors. I gave up fixing the error and undo the changes.

So, I added setlocale() inside the pngquant_main_internal() function (or read_image() function) as GustJc did. I don't know if this is really the right thing to do, but it seems to be working so far.

from pngquant.

Guest126 avatar Guest126 commented on June 20, 2024 1

Comrade, I build it! You can download here.
https://github.com/Guest126/pngquant/releases/tag/2.16.0-patch-1

from pngquant.

ImportTaste avatar ImportTaste commented on June 20, 2024 1

@kornelski Could you please address this? If it's a compilation problem, an earlier comment in this issue has a successfully completed compilation and the person who compiled it explains how it was accomplished.

I just noticed that you remarked elsewhere that you were now using ARM to compile and you've been having trouble. Why not rely on GitHub actions to build the binaries for you?

from pngquant.

kubinka0505 avatar kubinka0505 commented on June 20, 2024

Although I don't understand anything - thanks for detailed explanation, I will definitely use this.

However, I will keep this issue opened until the official download link will be updated. Sorry.

from pngquant.

kornelski avatar kornelski commented on June 20, 2024

Updated

from pngquant.

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.