-
Notifications
You must be signed in to change notification settings - Fork 333
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
[Merged by Bors] - Add additional image validation #464
Conversation
I believe this should be updated to only check for file size restrictions and ignore aspect ratio. With the current card layout, using the wrong aspect ratio might not look great, but it isn't an issue like size is. |
That's fine. Unfortunately, I guess I'll just rip out the rest of the image validation (leaving file size) as well. |
With a constant and common aspect ratio on the website to aim for, more users are getting it right.
7738f32
to
7325437
Compare
Okay, that is done.
|
Oh, 😦 that is unfortunate, well, I guess we'll be able to add it back in the future For the CI failure, #520 this should fix it, it's not caused by this PR |
Yeah, happy to do that later. I am pretty sure that the next release of |
We will need to do something about the images for |
@BorisBoutillier with your permission, I'd like to swap out Kataster's image with this smaller `webp` version. ([link to animated preview](https://raw.githubusercontent.com/bevyengine/bevy-assets/f1ad2af8b53adaff68622cbe981791f66b80e974/Apps/Games/Kataster.webp)) <img width="309" alt="image" src="https://user-images.githubusercontent.com/200550/213757436-e4919ad1-6df4-4b14-9628-1cce7bcb7135.png"> This is a re-recording that hopefully captures the same spirit and quality. I took some liberties to remove the title bar and match the game's aspect ratio to what's displayed on the website. Context: I'm trying to add image size validation to the CI (bevyengine/bevy-website#464), and there are a few images that are currently over the size limit. If you'd prefer to cut a new recording yourself, that's great.
@Trouv with your permission, I'd like to swap out `bevy_ecs_ldtk`'s image with this smaller version. You can see it animated side by side with the previous version in the changed files tab. <img width="311" alt="image" src="https://user-images.githubusercontent.com/200550/213820696-40d1b246-fa25-4feb-8ebc-5b3a4f401576.png"> This is a re-recording that hopefully captures the same spirit and image quality. I took some liberties to match the game's aspect ratio to what's displayed on the website and get the file size down. Context: I'm trying to add image size validation to the CI (bevyengine/bevy-website#464), and there are a few images that are currently over the size limit. If you'd prefer to cut a new recording yourself, that's great. There's no rush. I just thought it would be rude to ask you to re-do it without giving you an easy option.
Fingers crossed this should work now. bors r+ |
Updating this old code on top of the recent improvements to the validator. Some previous discussion in #443 Some recent motivation in [#253](bevyengine/bevy-assets#253) ## Objective - Shorten the feedback loop for users submitting their projects to `bevy_assets` - Help maintainers enforce restrictions related to image size - ~~Improve the overall look and feel of the assets page by enforcing a reasonable aspect ratio~~ - Improve the performance of the assets page and reduce the repository size by enforcing a maximum file size - Make validation errors output a little more clear for users ## Example Output Note: Some of these validations are no longer present in this PR. ``` Fish Fight: Punchy Image dimensions must not exceed 1000x1000 px. Image aspect ratio must be between 1 and 2. taipo Description must be at most 100 chars in length. Image file not found. Bevy Combat Image file must be at most 1000000 bytes. Typey Birb Image aspect ratio must be between 1 and 2. Cheaters Never Win Image dimensions must not exceed 1000x1000 px. Image aspect ratio must be between 1 and 2. Error: 28 asset(s) are invalid. ``` ## Discussion Points This is currently a draft because many existing images do not currently meet these restrictions. For file size restrictions, we could manually fix up the files. But for image aspect ratio, I think we would need to find a way to "grandfather in" the old images. I contemplated a static list of grandfathered assets, but that would prevent validations from working if users attempt to update those in the future. Also, see #448 where we decided to use a single aspect ratio on the website. If that were fixed, we might want to rework the some of the validations like - Enforce a fixed image size rather than a maximum - Remove the separate aspect ratio check all-together The current file size limit in the PR seems clearly too large. I think something like 250kb would be more appropriate, but that would require a lot more work on existing assets.
Build failed: |
well that's new and exciting |
bors r+ |
I'm going to go with cargo bug on the server side 🤷 |
Updating this old code on top of the recent improvements to the validator. Some previous discussion in #443 Some recent motivation in [#253](bevyengine/bevy-assets#253) ## Objective - Shorten the feedback loop for users submitting their projects to `bevy_assets` - Help maintainers enforce restrictions related to image size - ~~Improve the overall look and feel of the assets page by enforcing a reasonable aspect ratio~~ - Improve the performance of the assets page and reduce the repository size by enforcing a maximum file size - Make validation errors output a little more clear for users ## Example Output Note: Some of these validations are no longer present in this PR. ``` Fish Fight: Punchy Image dimensions must not exceed 1000x1000 px. Image aspect ratio must be between 1 and 2. taipo Description must be at most 100 chars in length. Image file not found. Bevy Combat Image file must be at most 1000000 bytes. Typey Birb Image aspect ratio must be between 1 and 2. Cheaters Never Win Image dimensions must not exceed 1000x1000 px. Image aspect ratio must be between 1 and 2. Error: 28 asset(s) are invalid. ``` ## Discussion Points This is currently a draft because many existing images do not currently meet these restrictions. For file size restrictions, we could manually fix up the files. But for image aspect ratio, I think we would need to find a way to "grandfather in" the old images. I contemplated a static list of grandfathered assets, but that would prevent validations from working if users attempt to update those in the future. Also, see #448 where we decided to use a single aspect ratio on the website. If that were fixed, we might want to rework the some of the validations like - Enforce a fixed image size rather than a maximum - Remove the separate aspect ratio check all-together The current file size limit in the PR seems clearly too large. I think something like 250kb would be more appropriate, but that would require a lot more work on existing assets.
Pull request successfully merged into master. Build succeeded: |
@BorisBoutillier with your permission, I'd like to swap out Kataster's image with this smaller `webp` version. ([link to animated preview](https://raw.githubusercontent.com/bevyengine/bevy-assets/f1ad2af8b53adaff68622cbe981791f66b80e974/Apps/Games/Kataster.webp)) <img width="309" alt="image" src="https://user-images.githubusercontent.com/200550/213757436-e4919ad1-6df4-4b14-9628-1cce7bcb7135.png"> This is a re-recording that hopefully captures the same spirit and quality. I took some liberties to remove the title bar and match the game's aspect ratio to what's displayed on the website. Context: I'm trying to add image size validation to the CI (bevyengine/bevy-website#464), and there are a few images that are currently over the size limit. If you'd prefer to cut a new recording yourself, that's great.
@Trouv with your permission, I'd like to swap out `bevy_ecs_ldtk`'s image with this smaller version. You can see it animated side by side with the previous version in the changed files tab. <img width="311" alt="image" src="https://user-images.githubusercontent.com/200550/213820696-40d1b246-fa25-4feb-8ebc-5b3a4f401576.png"> This is a re-recording that hopefully captures the same spirit and image quality. I took some liberties to match the game's aspect ratio to what's displayed on the website and get the file size down. Context: I'm trying to add image size validation to the CI (bevyengine/bevy-website#464), and there are a few images that are currently over the size limit. If you'd prefer to cut a new recording yourself, that's great. There's no rush. I just thought it would be rude to ask you to re-do it without giving you an easy option.
Updating this old code on top of the recent improvements to the validator.
Some previous discussion in #443
Some recent motivation in #253
Objective
bevy_assets
Improve the overall look and feel of the assets page by enforcing a reasonable aspect ratioExample Output
Note: Some of these validations are no longer present in this PR.
Discussion Points
This is currently a draft because many existing images do not currently meet these restrictions.
For file size restrictions, we could manually fix up the files.
But for image aspect ratio, I think we would need to find a way to "grandfather in" the old images. I contemplated a static list of grandfathered assets, but that would prevent validations from working if users attempt to update those in the future.
Also, see #448 where we decided to use a single aspect ratio on the website. If that were fixed, we might want to rework the some of the validations like
The current file size limit in the PR seems clearly too large. I think something like 250kb would be more appropriate, but that would require a lot more work on existing assets.