Skip to content

[Products]: Upload/insert a product image for quotes and invoices #62

Closed as duplicate

Description

@nielsdrost7

Context


spacecabbie: This is a important one for quotes IMHO i like to add some detailed suggestions: make them auto resize and convert to webp for space saving other wise filesystem gets these big png files


Specific:

As a user, I want quote images to automatically resize and convert to WebP format upon upload to optimize storage.

Measurable:

The size of newly uploaded quote images will be reduced by at least 50% after resizing and converting to WebP.

Achievable:

The Laravel application has sufficient libraries and server resources to perform image resizing and WebP conversion.

Relevant:

Optimizing image storage for quotes directly addresses concerns about filesystem capacity and performance.

Time-bound:

This feature will be implemented and deployed within the next two development sprints (two weeks).


Arrange:

// 1. Create a test user and authenticate.
// 2. Create a dummy JPEG image file for testing.
// 3. Define the expected WebP image path and filename based on the original image name.
// 4. Set the maximum allowed image width and height for resizing (e.g., 800x600).
// 5. Configure the expected compression quality for WebP conversion (e.g., 80).

Act:

// 1. Simulate a file upload request to the quote image upload endpoint.
// 2. Retrieve the newly created quote model from the database.
// 3. Get the file path of the generated WebP image.
// 4. Get the original JPEG image size.
// 5. Get the converted WebP image size.

Assert:

// 1. Assert that the quote model was created successfully.
// 2. Assert that the WebP image file exists at the expected path.
// 3. Assert that the WebP image size is less than 50% of the original JPEG image size.
// 4. Assert that the image dimensions of the WebP image are less than or equal to the maximum allowed width and height.
// 5. Assert that the MIME type of the generated image is 'image/webp'.


Activity

  1. added this to the v2.0.0-alpha milestone on Dec 28, 2025
  2. nielsdrost7 commented on Jan 2, 2026

    @nielsdrost7
    CollaboratorAuthor

    @coderabbitai make pull-request with AAA test Scenario's: Arrange, Act, Assert. And also make sure you test edge cases

  3. coderabbitai commented on Jan 2, 2026

    @coderabbitai
    Contributor

    Rate Limit Exceeded

    @nielsdrost7 have exceeded the limit for the number of chat messages per hour. Please wait 0 minutes and 29 seconds before sending another message.

  4. changed the title [-][Core] Allow the user to upload/insert a product image that will be shown in quotes and invoices.[/-] [+][Products]: Upload/insert a product image for quotes and invoices[/+] on Jun 13, 2026
  5. nielsdrost7 commented on Jun 13, 2026

    @nielsdrost7
    CollaboratorAuthor

    Closing in favour of #388 — all discussion and tracking continues there.

    Note: the image auto-resize and WebP conversion detail from this issue (originally suggested by @spacecabbie) has been noted in the consolidation for consideration during implementation.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions