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

ASSETS-23937 - Support setting a color as background color #214

Merged
merged 11 commits into from
Jan 16, 2024

Conversation

tmathern
Copy link
Member

@tmathern tmathern commented Jan 10, 2024

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

  • Add support for the instruction that is already used in some workers to set a background color, pdfbgcolor;
  • Allowed color schemes: hex color or valid numerical value for a color channel (the same value will be used for the three RGB channels);
  • Does not do any aio/asset-compute-plugin dependencies update for now, as something seems to be broken when running tests (see Update aio cli  #213).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (3f2d7d3) 57.99% compared to head (428a08e) 56.95%.
Report is 1 commits behind head on master.

Files Patch % Lines
lib/postprocessing/image.js 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #214      +/-   ##
==========================================
- Coverage   57.99%   56.95%   -1.05%     
==========================================
  Files          12       12              
  Lines         819      834      +15     
==========================================
  Hits          475      475              
- Misses        344      359      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tmathern tmathern changed the title Test run Support setting a color as background color Jan 10, 2024
@tmathern tmathern changed the title Support setting a color as background color ASSETS-23937 - Support setting a color as background color Jan 10, 2024
@tmathern tmathern self-assigned this Jan 10, 2024
@tmathern tmathern marked this pull request as ready for review January 10, 2024 23:41
@@ -15,7 +15,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
node-version: [14.16.1, 14.17]
node-version: [14.17]
Copy link
Member Author

Choose a reason for hiding this comment

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

Dropping the oldest version.
I didn't update to a newer one because currently it breaks the test pipeline, since dependency hell in #213.

@@ -0,0 +1,4 @@
{
"fmt": "png",
"pdfbgcolor": "#0EF"
Copy link
Member Author

Choose a reason for hiding this comment

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

This tests mimics adding a color as a background to any image with a transparent background


function handleTransparency(img, instructions) {
if(instructions.pdfbgcolor) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if we expect the supported format to be png then the condition should specify it.
if(instructions.pdfbgcolor && instructions.fmt === 'png') {

Copy link
Member Author

Choose a reason for hiding this comment

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

at that point we'd support anything, since the whole imagemagick command will do the conversion. It's the input we expect to be PNG.

@tmathern tmathern merged commit 49d52a1 into master Jan 16, 2024
4 of 6 checks passed
@tmathern
Copy link
Member Author

(Failing dependent tests expected, since the failing worker for PDF needs some adaptation to avoid double-processing)

@adobe-bot
Copy link

🎉 This PR is included in version 4.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants