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

Feature: Rename Company Logo on upload and housekeeping of company_logo files #3930

Open
objecttothis opened this issue Feb 20, 2024 · 2 comments

Comments

@objecttothis
Copy link
Member

objecttothis commented Feb 20, 2024

Current OSPOS 3.3.9 behavior for company logo in OSPOS > Configuration > Information is

  • Upload the file as is given by the user and not rename.
  • When removing the company logo to not remove the file but just replace the value for the filename with an empty string.
  • Changing the company_logo does not remove any old company logo.

Proposed changes

  • save the default logo as default_company_logo.jpg. This is the OpensourcePOS logo. (The default logo is embedded as an SVG and is visible if a custom company logo is not present so this change is not needed)
  • Clicking "Remove Image" causes the current image to be deleted on disk and the value of the company_logo in the database be set to default_company_logo.jpg. Clicking "Remove Image" would retain it's current behavior of causing the button on the view to read "Select Image" even though technically it has the default company logo file that it displays.
  • Adding or changing company logo causes the uploaded file to be renamed to company_logo.[ext] where [ext] is the result of file->guessExtension();

These changes would result in

  • Always having some image on the login landing page rather than the blank company logo section that looks sort of awkward when "Remove Image" has been clicked. (already present behavior)
  • Keeping /public/uploads/ free from clutter.

Thoughts?

@objecttothis objecttothis modified the milestone: 3.4.0 Feb 26, 2024
@jekkos
Copy link
Member

jekkos commented Mar 23, 2024

So we always have a max of two files for the logo active at the same time

  • company_logo
  • default_company_logo

the first one is renamed and overwritten from any file that is uploaded. If it does not exist, due to it being deleted or not uploaded yet, then we fallback to the second default one/

@objecttothis
Copy link
Member Author

So we always have a max of two files for the logo active at the same time

  • company_logo
  • default_company_logo

the first one is renamed and overwritten from any file that is uploaded. If it does not exist, due to it being deleted or not uploaded yet, then we fallback to the second default one/

That was my original thought but then I realized that the default logo is an embedded SVG, no no need to keep it on disk. Someone did ask for the possibility to have a custom logo AND receipt logo though. I think due to poor print quality on thermal printers people asked for the ability to do a b/w version.

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

No branches or pull requests

2 participants