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

Media API does not return width and height of image #938

Closed
NicoHood opened this issue Sep 4, 2022 · 3 comments
Closed

Media API does not return width and height of image #938

NicoHood opened this issue Sep 4, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@NicoHood
Copy link
Contributor

NicoHood commented Sep 4, 2022

Looking at https://listmonk.app/docs/apis/media/#get-apimedia the api should return width and height. But they dont for me. I am using 2.2.0 right now.

Something like this would be expected:

{
    "data": [
        {
            "id": 1,
            "uuid": "ec7b45ce-1408-4e5c-924e-965326a20287",
            "filename": "Media file",
            "width": 1080,
            "height": 1080,
            "created_at": "2020-04-08T22:43:45.080058+01:00",
            "thumb_uri": "/uploads/thumb_Media file",
            "uri": "/uploads/Media filE"
        }
    ]
}
@knadh
Copy link
Owner

knadh commented Sep 10, 2022

Ah, this is an error in the documentation. The width and height of images are not stored in the database. Just fixed it.

@knadh knadh closed this as completed Sep 10, 2022
@knadh knadh added the documentation Improvements or additions to documentation label Sep 10, 2022
@NicoHood
Copy link
Contributor Author

Why? Dont you want to add this?

@knadh
Copy link
Owner

knadh commented Sep 12, 2022

Since there are plans to add non-image media (arbitrary files), I was thinking width and height wouldn't be universally meaningful to all API responses. Non image files will come back with nulls. But, thinking about it, it is useful to have this information. Maybe it can be in a meta field. eg: meta: { width, height}. Re-opening the issue.

@knadh knadh reopened this Sep 12, 2022
@knadh knadh added enhancement New feature or request and removed documentation Improvements or additions to documentation labels Sep 20, 2022
@knadh knadh closed this as completed in c381004 Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants