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

Switch to Piston's image library #3368

Closed
jdm opened this issue Sep 16, 2014 · 18 comments
Closed

Switch to Piston's image library #3368

jdm opened this issue Sep 16, 2014 · 18 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Sep 16, 2014

rust-image appears to support everything we require from an image library right now, and it's native rust code. It would be nice to scrap stb-image and rust-png if possible, but we should definitely take some measurements to sure what the performance is like before and after switching.

@jdm
Copy link
Member Author

@jdm jdm commented Sep 19, 2014

Note: NCSU students are working on this project, so please contact me before commencing any work on this to avoid overlap.

@kmcallister kmcallister changed the title Measure replacing image-loading libraries with rust-image Switch to Piston's image library Mar 25, 2015
@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented Mar 25, 2015

Is there any update on this? @pcwalton says stb-image is the biggest blocker for Facebook timeline -- it can't decode any of their images. That's aside from the security issues that block dogfooding or a tech demo release.

I'm not too worried about image decoding performance at the moment. It's tiny compared to some of the current inefficiencies in resource loading etc. If it shows up in profiles then we can investigate.
Right now Servo's interaction with image decoders is very basic: send some bytes, get (width, height) and a vector of pixels. It's not hard to switch decoders, and Piston's library seems like a good medium-term solution.

@jdm
Copy link
Member Author

@jdm jdm commented Mar 25, 2015

#4215 worked, but the students never addressed the review comments and it needs a new owner.

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented Mar 25, 2015

I'll try to revive that PR.

kmcallister added a commit to kmcallister/servo that referenced this issue Mar 26, 2015
We still use libpng for `servo -o` and the reftest runner.

Based on servo#4215. Fixes servo#3368.
kmcallister added a commit to kmcallister/servo that referenced this issue Apr 1, 2015
We still use libpng for `servo -o` and the reftest runner.

Based on servo#4215. Fixes servo#3368.
@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 7, 2015

Working on this again now that the rustup has landed.

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 7, 2015

Now waiting on image-rs/image#401.

@kmcallister kmcallister self-assigned this May 7, 2015
kmcallister added a commit to kmcallister/servo that referenced this issue May 7, 2015
We still use libpng for `servo -o` and the reftest runner.

Based on servo#4215. Fixes servo#3368.
@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 7, 2015

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 8, 2015

Those are fixed; now it's image-rs/image#409.

@waddlesplash
Copy link

@waddlesplash waddlesplash commented May 12, 2015

That was fixed in image-rs/image#412, so there are no more blockers, correct?

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 12, 2015

There are some other issues I didn't file yet :/

I'm going to spend some time looking into piston-image compatibility issues.

@kmcallister
Copy link
Contributor

@kmcallister kmcallister commented May 13, 2015

Now tracking these as image-rs/image#413. See also the testing report.

@kmcallister kmcallister added this to the Dogfooding milestone May 17, 2015
@kmcallister kmcallister removed their assignment Jun 11, 2015
@frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Jul 28, 2015

@notriddle Did you make progress on this? Run into any issues? I noticed you have a commit on your forked Servo

@jdm jdm added E-less easy and removed E-easy labels Jul 28, 2015
@notriddle
Copy link
Contributor

@notriddle notriddle commented Jul 28, 2015

I had it mostly working (WebP wouldn't work, but I think that might be a
problem in Piston-Image). But then they made images serializable, and that
broke it.

On Tue, Jul 28, 2015 at 8:16 AM Corey Farwell notifications@github.com
wrote:

@notriddle https://github.com/notriddle Did you make progress on this?
Run into any issues? I noticed you have a commit on your forked Servo


Reply to this email directly or view it on GitHub
#3368 (comment).

@jdm
Copy link
Member Author

@jdm jdm commented Jul 28, 2015

@notriddle Other libraries have accepted configurable serialization PRs, such as servo/rust-url#118 and hyperium/hyper#603 . Might be worth a try!

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Oct 1, 2015

We need this to decode favicons in browser.html. Do we still want to use this library?

@metajack
Copy link
Contributor

@metajack metajack commented Oct 1, 2015

We would need to use some favicon library. stb-image is not usable long term (if it supports favicons and that is your concern). Maybe we need to add favicon support to rust-image?

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Oct 8, 2015

Now that images use shared memory (#6705), just adding a serde feature to the image crate is not enough; we'd need to make it use the ipc-channel crate too and change how it allocates memory for image data.

Rather than push all this stuff directly into image, I think in the short term we can should use image similarly to how we currently use png and stb_image: Just use it to decode the data, then copy the results into our shared-memory image struct.

Compared to the code in #4215 this will mean keeping more of Servo's current code around, at least for now. I think I'll start a new PR from scratch for this short-term solution, unless there are any objections.

(In the long term when Rust's "placement new" equivalent is fully implemented and stabilized, maybe we can make image work with generic custom "placers" including one for IpcSharedMemory, and then revive the changes from #4215 that uses image types more directly.)

@mbrubeck mbrubeck self-assigned this Oct 8, 2015
mbrubeck added a commit to mbrubeck/servo that referenced this issue Oct 8, 2015
mbrubeck added a commit to mbrubeck/servo that referenced this issue Oct 8, 2015
mbrubeck added a commit to mbrubeck/servo that referenced this issue Oct 9, 2015
mbrubeck added a commit to mbrubeck/servo that referenced this issue Oct 9, 2015
bors-servo pushed a commit that referenced this issue Oct 9, 2015
Replace stb_image with PistonDevelopers/image

Fixes #3368. r? @glennw 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7933)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Oct 9, 2015
Replace stb_image with PistonDevelopers/image

Fixes #3368. r? @glennw 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7933)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Oct 9, 2015
Replace stb_image with PistonDevelopers/image

Fixes #3368. r? @glennw 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7933)
<!-- Reviewable:end -->
mbrubeck added a commit to mbrubeck/servo that referenced this issue Oct 9, 2015
bors-servo pushed a commit that referenced this issue Oct 9, 2015
Replace libpng and stb_image with PistonDevelopers/image

Fixes #3368. r? @glennw 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7933)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Oct 10, 2015
Replace libpng and stb_image with PistonDevelopers/image

Fixes #3368. r? @glennw 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7933)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Oct 12, 2015
Replace libpng and stb_image with PistonDevelopers/image

Fixes #3368. r? @glennw 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7933)
<!-- Reviewable:end -->
@frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Oct 25, 2015

For what it's worth, this PR caused a regression and Google News now panics: #8093

EDIT: meant to comment on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.