Skip to content

[6.0] feat(task/checkfiles): Introduce image compression #40658

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

Open
wants to merge 7 commits into
base: 6.0-dev
Choose a base branch
from

Conversation

ditsuke
Copy link
Contributor

@ditsuke ditsuke commented May 25, 2023

Summary of Changes

Introduces image compression to the image resizer plugin.

Why?

Resizing might result in a size increase, so we leave an option to compress.

Testing Instructions

  • Drop some images in a media folder (mix PNG, WEBP, JPG)
  • Configure a checkfiles task to resize/compress these images
  • Verify that the resized images are compressed with the right level.

Actual result BEFORE applying this Pull Request

No compression option. Image size may go up after the resize process.

Expected result AFTER applying this Pull Request

Compression option.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.3-dev labels May 25, 2023
@ditsuke ditsuke force-pushed the feat/image-resizer-compression branch from 5fd8461 to 6be9ed1 Compare May 25, 2023 21:05
@joomla-cms-bot joomla-cms-bot added Unit/System Tests and removed Language Change This is for Translators labels May 25, 2023
@ditsuke ditsuke changed the base branch from 4.3-dev to 5.0-dev May 25, 2023 21:24
@MrMusic
Copy link

MrMusic commented May 26, 2023

I suspect a mistake between compression <-> quality.
Usually, when processing jpeg images, the 'quality' is set in the range from 0 to 100, not the compression: Lower values are poor quality. Higher values are better quality.
To be consistent we should use 'quality'.

@ditsuke
Copy link
Contributor Author

ditsuke commented May 26, 2023

I suspect a mistake between compression <-> quality. Usually, when processing jpeg images, the 'quality' is set in the range from 0 to 100, not the compression: Lower values are poor quality. Higher values are better quality. To be consistent we should use 'quality'.

Honestly I'd prefer quality too, just that the initial discussion I had regarding this feature we talked about compression.

@ceford
Copy link
Contributor

ceford commented Sep 13, 2023

I have tested this item 🔴 unsuccessfully on 38458ad

Several problems with the patch applied:
I see string keys rather than strings as the last Task Parameter
PLG_TASK_CHECK_FILES_LABEL_COMPRESSION *
PLG_TASK_CHECK_FILES_LABEL_COMPRESSION_DESC

I think the default value should be something reasonable, perhaps 75 rather than 0

The task does not actually run - Run Test just gives a Task: "Resize images" popup that never completes. If I close it I see a Running since ... Icon.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40658.

@HLeithner HLeithner changed the base branch from 5.0-dev to 5.1-dev September 30, 2023 22:50
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.1-dev.

@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:08
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@HLeithner HLeithner changed the title feat(task/checkfiles): Introduce image compression [5.2] feat(task/checkfiles): Introduce image compression Apr 24, 2024
@ChrisHoefliger
Copy link

I have tested this item ✅ successfully on 38458ad

I have tested this with an image of 5.3MB and 6000px width. Compressed to a width of 1200px and 80% quality it resulted in a file size of 669kB


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40658.

1 similar comment
@ChrisHoefliger
Copy link

I have tested this item ✅ successfully on 38458ad

I have tested this with an image of 5.3MB and 6000px width. Compressed to a width of 1200px and 80% quality it resulted in a file size of 669kB


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40658.

@dorisdreher
Copy link

I have tested this item ✅ successfully on 38458ad


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40658.

@@ -20,7 +20,7 @@
label="PLG_TASK_CHECK_FILES_LABEL_IMAGE_DIMENSION"
required="true"
default="width"
>
>
Copy link
Contributor

Choose a reason for hiding this comment

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

please revert this change

@@ -11,7 +11,7 @@
hide_none="true"
required="true"
validate="options"
>
>
Copy link
Contributor

Choose a reason for hiding this comment

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

please revert this change

@brianteeman
Copy link
Contributor

I have no idea how you can say that you have tested this as at a minimum the new language strings are in the wrong file so it can only ever display the language keys as reported by @ceford earlier

image

Comment on lines +8 to +9
PLG_TASK_CHECK_FILES_LABEL_COMPRESSION="Compression"
PLG_TASK_CHECK_FILES_LABEL_COMPRESSION_DESC="Choose the compression level to use when compressing files. 0 = no compression, 100 = maximum compression."
Copy link
Contributor

Choose a reason for hiding this comment

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

These strings should NOT be in the .sys.ini file They will do nothing here.

@brianteeman
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 38458ad


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40658.

@brianteeman
Copy link
Contributor

Tried to do a test run

image

@HLeithner HLeithner changed the base branch from 5.2-dev to 5.3-dev September 2, 2024 08:52
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.2] feat(task/checkfiles): Introduce image compression [5.3] feat(task/checkfiles): Introduce image compression Sep 2, 2024
@Hackwar Hackwar removed the PR-5.2-dev label Sep 3, 2024
@HLeithner HLeithner changed the base branch from 5.3-dev to 6.0-dev March 4, 2025 17:22
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 6.0-dev.

@HLeithner HLeithner changed the title [5.3] feat(task/checkfiles): Introduce image compression [6.0] feat(task/checkfiles): Introduce image compression Mar 4, 2025
@rdeutz rdeutz removed the PR-5.3-dev label Mar 5, 2025
@exlemor exlemor moved this to Abandoned in PR Cleanup May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Abandoned
Development

Successfully merging this pull request may close these issues.