Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:21
    HeroicKatora edited #1433
  • 08:21
    HeroicKatora closed #1628
  • 08:21
    HeroicKatora commented #1620
  • 08:21
    HeroicKatora commented #1620
  • 08:20
    HeroicKatora closed #1624
  • 08:19

    HeroicKatora on master

    Refactors and adding lossless b… Added stuff to deal with transf… Fixed bit reader, added lots of… and 18 more (compare)

  • 07:48
    johannesvollmer commented #1404
  • 07:40
    johannesvollmer commented #1404
  • 07:40
    johannesvollmer commented #1404
  • 07:15
    tristanphease synchronize #1624
  • Nov 28 03:51
    tristanphease synchronize #1624
  • Nov 27 14:34
    simon-frankau closed #1627
  • Nov 27 14:34
    simon-frankau commented #1627
  • Nov 27 11:18
    HeroicKatora commented #1627
  • Nov 27 11:14
    simon-frankau opened #1628
  • Nov 27 11:10
    simon-frankau opened #1627
  • Nov 27 10:28
    johannesvollmer closed #1622
  • Nov 27 10:27
    johannesvollmer commented #1622
  • Nov 27 10:27
    johannesvollmer commented #1626
  • Nov 27 09:37

    HeroicKatora on master

    update exr version to 1.4.0 Merge branch 'master' into upda… Merge pull request #1626 from j… (compare)

HeroicKatora
@heroic_katora:matrix.org
[m]
It's also far more likely that Issues are opened for erroneous errors than for pathological cases.
And we can more easily throw a fuzzer run in than run against the vastness of images on the internet.
5225225
@r522:matrix.org
[m]
heads up HeroicKatora : ravif 0.7.0 has been yanked so cargo check on a clean checkout of image-rs/image doesn't build, bumping it to 0.8.0 looks to work fine
can make a PR to do that bump if you want
HeroicKatora
@heroic_katora:matrix.org
[m]
Sure, feel free to do.
Do you happen to know why it was yanked? Not that it really matters if the bump is a clean one to do
5225225
@r522:matrix.org
[m]
no idea
no mention of it in the issue tracker
there is a yank mentioned because it didn't build, but i'm assuming 0.7.0 built fine
HeroicKatora
@heroic_katora:matrix.org
[m]
Yeah, although a weird reason to yank. It always required a pretty precise/recent version of nasm to build so maybe that's a nudge to use the correct version
5225225
@r522:matrix.org
[m]

image-rs/image#1564

bumped it from 0.7.0 to 0.8.0, and marked the issue about it as Fixes:

tests look fine on my side but i'd definitely check if CI has any problems with it

oh wait yeah
avif isn't run by default
okay it's not a clean bump, i just didn't see the error
looks like just a single type changed tho
HeroicKatora
@heroic_katora:matrix.org
[m]
Ah well, that's still good.
5225225
@r522:matrix.org
[m]
the afl-fuzz target doesn't compile on CI
but i can't seem to reproduce that locally
HeroicKatora
@heroic_katora:matrix.org
[m]

error: failed to run LLVM passes: unknown pass name 'sancov'

Huh, I guess something about the new pass manager in nightly?

5225225
@r522:matrix.org
[m]
unless it's very new
HeroicKatora
@heroic_katora:matrix.org
[m]
Yeah, that one is very new
5225225
@r522:matrix.org
[m]
i'll try updating my nightly and trying again
HeroicKatora
@heroic_katora:matrix.org
[m]
Like 3 days old
5225225
@r522:matrix.org
[m]
looks to be unfixed upstream
HeroicKatora
@heroic_katora:matrix.org
[m]
Heh, the afl library also moved on 7 versions since it was last updated.
I've only been using the rust-fuzz target :)
(libfuzzer/cargo-fuzz) I mean
5225225
@r522:matrix.org
[m]
yep
i don't know if it's worth keeping around afl if we already use libfuzzer
not used afl but if it's not significantly better at finding stuff, we could remove it?
HeroicKatora
@heroic_katora:matrix.org
[m]
Yeah, I was considering the same just now. Let me try just bumping to latest and if that works I'll PR it quickly.
And forcibly merge :)
Which I'll do for the ravif one as well
5225225
@r522:matrix.org
[m]
cool
i have a fix for image-rs/image#1501 in a draft PR, just running the fuzzer for a bit to see if it finds any other issues, then I'll open up the PR (image-rs/image#1563)
5225225
@r522:matrix.org
[m]

also, thoughts on adding limits to jpeg-decoder?

https://github.com/image-rs/jpeg-decoder/blob/ab6d326a7b194568725731a19603fb580814452d/src/decoder.rs#L277 is at least one source of unbounded allocation, but I saw discussion on trying to make it library-wide image-rs/image#938.

HeroicKatora
@heroic_katora:matrix.org
[m]
So the library wide version is 'advisory' first and it's not necessary to implement for decoders. We're still looking for real world feedback if it's okay to reject some of the image formats if a limit is requested (I mean, there is no version with it released so far..).
On limits for jpeg in particular, sure, yeah. It would be cool to have it in 0.2
It's probably quite huge of a thing to thread through all the code though. So it would be interesting to first evaluate if the interface allows adding it and fix any issues there, and only then actually add it incrementally afterwards.
Jacob Mischka
@jacobmischka:matrix.org
[m]
I'm trying to convert a vec of bytes of unknown format (via with_guessed_format) to a new vec of bytes in JPEG format. The resulting images are viewable and the correct size, but incomplete, the bottom half or so is just grey. Am I doing something obvious wrong?
Sorry for lack of details, I'm walking and on mobile at the moment. I can provide more in a little bit when I'm back at my desk.
I'm flushing the writer that I'm ultimately using to write those bytes, so I don't think that is the issue. But I could be wrong of course.
I'm just doing this to write to the vec
let mut bytes: Vec<u8> = Vec::new();
// read data to end from incoming stream
let img = ImageReader::new(Cursor::new(bytes)).decode()?;
let mut bytes: Vec<u8> = Vec::new();
img.write_to(&mut bytes, image::ImageOutputFormat::Jpeg(90))?;
er, hm sorry I don't seem to know how to insert code via mobile obviously
HeroicKatora
@heroic_katora:matrix.org
[m]
That looks correct to me. Have you tried decoding it to a raw image with jpeg-decoder crate directly?
Or utilizing its example/decode.rs. If the image there still shows up with a grey portion then we'd appreciate a bug report.
Please be sure to try out older versions of the repository as well (the git commit of the version you're depending on currently would be best).
Jacob Mischka
@jacobmischka:matrix.org
[m]

:point_up: Edit: I'm just doing this to write to the vec

let mut bytes: Vec<u8> = Vec::new();
// read data to end from incoming stream
let img = ImageReader::new(Cursor::new(bytes)).decode()?;
let mut bytes: Vec<u8> = Vec::new();
img.write_to(&mut bytes, image::ImageOutputFormat::Jpeg(90))?;

```

Jacob Mischka
@jacobmischka:matrix.org
[m]
Sorry, false alarm, it was the way I was writing it out
Thanks for your response, and thanks for your work on the library!
andres
@andresv:matrix.org
[m]

I wanna write some text to png file and essentially output must be only in black and white, because it is going to be printed with label printer and it works best with B/W images.

This is what I have at the moment and this makes text nice around the edges which introduces a lot of gray colors there. Is there a good way to convert it to B/W only.

use imageproc::drawing;
use rusttype::{Font, Scale};

let mut image = image::GrayImage::new(600, 600);
let font = Vec::from(include_bytes!("../ProFontForPowerline.ttf") as &[u8]);
let font = Font::try_from_vec(font).unwrap();
let text = "0e5f220ed35db656";

let font_height = 64.;
let scale = Scale {
    x: font_height,
    y: font_height,
};
drawing::draw_text_mut(&mut image, Luma([255u8]), 28, 16, scale, &font, text);
let _ = image.save("qr.png").unwrap();
andres
@andresv:matrix.org
[m]
A. Bos
@adhesivee
When loading an vertical JPG, it gets rotated after image::open.
Is there a way to prevent this from happening?
HeroicKatora
@heroic_katora:matrix.org
[m]
We just load the pixel matrix, an image's orientation is usually stored as an attribute separate from it.
For accessing such meta data you'll need to use the jpeg decoder direct (as in, the crate)
A. Bos
@adhesivee
Thanks found it. Working like a charm now
Marco Köpcke
@theCapypara
Hi everyone! I am a bit lost on using this library for my use case, and I'm not sure it's even supported: How do I create indexed images that use color palettes ("P" mode in PIL)?
And if it's not supported is there no library that supports it? I can't seem to find any other either.