Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/support sharp yuv #81

Conversation

joostoudeman
Copy link

In this PR I also added some logic to crossbuild the binaries.

webp version build is 1.3.0

@joostoudeman joostoudeman changed the title Feature/support sharp yuv usefulness Feature/support sharp yuv Jun 16, 2023
@mateuszkwiecinski
Copy link
Member

mateuszkwiecinski commented Jun 16, 2023

For some reason I can't push to your branch, here's the diff that should fix the compilation issue: a9478d8 (you can ignore the formatting changes, the Java code here is not formatted in a consistent way :/)
I'd love to know if these classes could be somehow automatically generated from .h files (since that's what the private static native methods point at), but that will remain a mystery for now 😛

Also, I'd like to cover the new feature with a test (to verify if an image can be written with a sharp YUV option), can you either add a test or share how do you use it, so I can try adding it later?

Copy link
Member

@mateuszkwiecinski mateuszkwiecinski Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file used? I couldn't find any usages of it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe dockcross maps the current folder to /build, and therefor in the docker container this will be the location for the sources.

./dockcross/dockcross-windows-static-x86 bash -c './compile.sh Windows x86'
./dockcross/dockcross-windows-static-x64 bash -c './compile.sh Windows x86_64'

docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-apple-darwin gotson/crossbuild ./compile.sh Mac x86_64 /workdir/multiarch-darwin.cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the gotson/crossbuild is name of the docker image you mentioned, right? This one: https://hub.docker.com/r/gotson/crossbuild

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is

@joostoudeman
Copy link
Author

It seems the run-diffuse fails. What does that do? How can we fix that?

@mateuszkwiecinski
Copy link
Member

mateuszkwiecinski commented Jun 16, 2023

It attempts to post comment showing how the output jar changes. It seems like it's a token permission issue 🤷
The comment would be:

Jar size:

Jar size change: +134.9KiB (3.0MiB -> 3.1MiB)

Diffuse output:

OLD: diffuse-source-file
NEW: pull-request-artifact.jar

│            compressed            │          uncompressed           
├──────────┬──────────┬────────────┼──────────┬──────────┬───────────
JAR   │ old      │ new      │ diff       │ old      │ new      │ diff      
───────┼──────────┼──────────┼────────────┼──────────┼──────────┼───────────
class │ 30.9 KiB │ 31.1 KiB │     +126 B │ 63.2 KiB │ 63.6 KiB │    +486 B 
other │    3 MiB │  3.1 MiB │ +134.7 KiB │  6.6 MiB │  6.5 MiB │ -94.9 KiB 
───────┼──────────┼──────────┼────────────┼──────────┼──────────┼───────────
total │    3 MiB │  3.1 MiB │ +134.9 KiB │  6.7 MiB │  6.6 MiB │ -94.4 KiB 

 CLASSES │ old │ new │ diff       
─────────┼─────┼─────┼────────────
classes │  15 │  15 │  0 (+0 -0) 
methods │ 467 │ 473 │ +6 (+6 -0) 
fields │  47 │  47 │  0 (+0 -0)
JAR
compressed       │      uncompressed      │                                                    
───────────┬────────────┼───────────┬────────────┤                                                    
size      │ diff       │ size      │ diff       │ path                                               
───────────┼────────────┼───────────┼────────────┼────────────────────────────────────────────────────
318.7 KiB │ +108.4 KiB │ 584.1 KiB │ +168.6 KiB │ ∆ native/Linux/armv7/libwebp-imageio.so            
290.7 KiB │  -53.9 KiB │ 672.9 KiB │ -214.4 KiB │ ∆ native/Windows/x86/webp-imageio.dll              
324.6 KiB │  +48.1 KiB │ 689.8 KiB │  +55.1 KiB │ ∆ native/Linux/ppc64/libwebp-imageio.so            
250 KiB │  +45.4 KiB │ 490.3 KiB │  +83.1 KiB │ ∆ native/Linux/armv6/libwebp-imageio.so            
371 KiB │  -44.1 KiB │ 865.2 KiB │ -207.2 KiB │ ∆ native/Windows/x86_64/webp-imageio.dll           
277.3 KiB │  +32.9 KiB │ 631.5 KiB │  +81.4 KiB │ ∆ native/Mac/x86_64/libwebp-imageio.dylib          
286.5 KiB │   -8.5 KiB │ 626.1 KiB │  -22.8 KiB │ ∆ native/Linux/x86/libwebp-imageio.so              
208.9 KiB │     -5 KiB │ 417.7 KiB │  -22.6 KiB │ ∆ native/Linux/arm/libwebp-imageio.so              
227.9 KiB │   +4.8 KiB │ 490.6 KiB │  +11.2 KiB │ ∆ native/Mac/aarch64/libwebp-imageio.dylib         
317.9 KiB │   +4.4 KiB │ 675.9 KiB │  -15.4 KiB │ ∆ native/Linux/x86_64/libwebp-imageio.so           
282.5 KiB │   +2.3 KiB │   533 KiB │  -11.9 KiB │ ∆ native/Linux/aarch64/libwebp-imageio.so          
2.3 KiB │      +64 B │   6.6 KiB │     +278 B │ ∆ com/luciad/imageio/webp/WebPEncoderOptions.class 
2.4 KiB │      +62 B │   6.4 KiB │     +208 B │ ∆ com/luciad/imageio/webp/WebPWriteParam.class     
───────────┼────────────┼───────────┼────────────┼────────────────────────────────────────────────────
3.1 MiB │ +134.9 KiB │   6.5 MiB │  -94.4 KiB │ (total)
CLASSES
METHODS:

   old │ new │ diff       
─────┼─────┼────────────
467 │ 473 │ +6 (+6 -0) 
+ com.luciad.imageio.webp.WebPEncoderOptions getUseSharpYUV() → boolean
+ com.luciad.imageio.webp.WebPEncoderOptions getUseSharpYUV(long) → int
+ com.luciad.imageio.webp.WebPEncoderOptions setUseSharpYUV(boolean)
+ com.luciad.imageio.webp.WebPEncoderOptions setUseSharpYUV(long, int)
+ com.luciad.imageio.webp.WebPWriteParam getUseSharpYUV() → boolean
+ com.luciad.imageio.webp.WebPWriteParam setUseSharpYUV(boolean)
I'm going to force merge it 🤷 thank you very much for your contribution 🙇

@mateuszkwiecinski mateuszkwiecinski merged commit 698cf9a into usefulness:master Jun 16, 2023
@joostoudeman joostoudeman deleted the feature/support-sharp-yuv-usefulness branch June 19, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants