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

[QA] tests for exceeding thumbnails max_input configs #10725

Open
2 of 4 tasks
saw-jan opened this issue Dec 4, 2024 · 7 comments
Open
2 of 4 tasks

[QA] tests for exceeding thumbnails max_input configs #10725

saw-jan opened this issue Dec 4, 2024 · 7 comments
Assignees
Labels

Comments

@saw-jan
Copy link
Member

saw-jan commented Dec 4, 2024

Bug report: #10589

Required envs: (change values if necessary)

THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE=1MB
THUMBNAILS_MAX_INPUT_WIDTH=100
THUMBNAILS_MAX_INPUT_HEIGHT=100

Test cases:

Pre-conditions:

  • run ocis with above thumbnails configs

Test:

@nirajacharya2
Copy link
Contributor

* [ ]  download the 32x32 thumbnail of that image

when i tested for dimentions 32x32 and 128x128 i get 200 response.

idk why its working for those dimentions.

@saw-jan

@nirajacharya2
Copy link
Contributor

* [ ]  download the 32x32 thumbnail of that image

when i tested for dimentions 32x32 and 128x128 i get 200 response.

idk why its working for those dimentions.

@saw-jan

i don't get the above problem locally but it is still present in ci
https://drone.owncloud.com/owncloud/ocis/42180/60/5

```shell @issue-10589 @env-config

Scenario Outline: try to download an image preview when the maximum thumbnail input value in the environment is set to a small value # /drone/src/tests/acceptance/features/coreApiWebdavPreviews/previews.feature:372

Given the following configs have been set:                                                                                               # OcisConfigContext::theConfigHasBeenSetToValue()
  | config                               | value |
  | THUMBNAILS_MAX_INPUT_IMAGE_FILE_SIZE | 1KB   |
  | THUMBNAILS_MAX_INPUT_WIDTH           | 200   |
  | THUMBNAILS_MAX_INPUT_HEIGHT          | 200   |
And using <dav-path-version> DAV path                                                                                                    # FeatureContext::usingOldOrNewOrSpacesDavPath()

And user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "/testimage.jpg"                                                   # FeatureContext::userHasUploadedAFileTo()
When user "Alice" downloads the preview of "/testimage.jpg" with width "32" and height "32" and processor thumbnail using the WebDAV API # FeatureContext::userDownloadsThePreviewOfWithWidthHeightProcessorUsingWebDAVAPI()
Then the HTTP status code should be "403"                                                                                                # FeatureContext::thenTheHTTPStatusCodeShouldBe()
And the value of the item "/d:error/s:message" in the response should be "thumbnails: image is too large"                                # WebDavPropertiesContext::assertValueOfItemInResponseIs()

Examples:
  | dav-path-version |
  | old              |
    Failed step: Then the HTTP status code should be "403"
    HTTP status code 200 is not the expected value 403
    Failed asserting that 200 matches expected '403'.
  | new              |
    Failed step: Then the HTTP status code should be "403"
    HTTP status code 200 is not the expected value 403
    Failed asserting that 200 matches expected '403'.
  | spaces           |
    Failed step: Then the HTTP status code should be "403"
    HTTP status code 200 is not the expected value 403
    Failed asserting that 200 matches expected '403'.



@saw-jan
Copy link
Member Author

saw-jan commented Dec 31, 2024

i have merged test with with dimension 36x36 because web uses 36x36 thumbnail

But you will actually get 64x64 res image not 36x36. but it is by design in ocis

@saw-jan
Copy link
Member Author

saw-jan commented Dec 31, 2024

The behavior is OK for image files. Trying to get thumbnail of an image exceeding any of THUMBNAILS_MAX_INPUT_* config returns 403

@saw-jan
Copy link
Member Author

saw-jan commented Dec 31, 2024

Same should be the behavior for text file as well. See the description above.

NOTE: for text files, 640x480 res image will be created for thumbnail processing

@saw-jan
Copy link
Member Author

saw-jan commented Dec 31, 2024

@nirajacharya2

i have merged test with with dimension 36x36 because web uses 36x36 thumbnail

Please, use 32 instead of 36 or use 64 if you want to follow web client

@saw-jan
Copy link
Member Author

saw-jan commented Dec 31, 2024

try to download the 200x200 (exceeding config value) thumbnail of that image

this statement is wrong. the requested res doesn't get affected by the configured max settings. Those settings are for the input image

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

No branches or pull requests

2 participants