-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat (web/server) 360 degrees Web panoramas [attempt 2] #3412
feat (web/server) 360 degrees Web panoramas [attempt 2] #3412
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@alextran1502 here is a new PR as you asked here #3098 Need your help to merge it. I added fix: changed "isPanorama" property to ProjectionType enum property. |
@brighteyed Hope I fixed all suggestions :) |
Need help with creating documentation and merging the change |
server/src/microservices/processors/metadata-extraction.processor.ts
Outdated
Show resolved
Hide resolved
server/src/microservices/processors/metadata-extraction.processor.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Sergey Kondrikov <[email protected]>
Co-authored-by: Sergey Kondrikov <[email protected]>
Co-authored-by: Jason Rasmussen <[email protected]>
…sor.ts Co-authored-by: Jason Rasmussen <[email protected]>
@jrasm91 I changed column to varchar Hope it is ready to be merged now :) Thanks |
There is a problem with code prettiffier locally. Once I save file in visual studio, it applies some format that is not accepted by checker :( |
const exifProjectionType = getExifProperty('ProjectionType'); | ||
let projectionType: ProjectionType = ProjectionType.NONE; | ||
|
||
if (exifProjectionType) { | ||
const exifPropertyUpper = exifProjectionType.toUpperCase(); | ||
|
||
if (exifPropertyUpper in ProjectionType) { | ||
projectionType = exifPropertyUpper as ProjectionType; | ||
} | ||
} | ||
|
||
newExif.projectionType = projectionType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const exifProjectionType = getExifProperty('ProjectionType'); | |
let projectionType: ProjectionType = ProjectionType.NONE; | |
if (exifProjectionType) { | |
const exifPropertyUpper = exifProjectionType.toUpperCase(); | |
if (exifPropertyUpper in ProjectionType) { | |
projectionType = exifPropertyUpper as ProjectionType; | |
} | |
} | |
newExif.projectionType = projectionType; | |
const projectionType = getExifProperty('ProjectionType'); | |
if (projectionType) { | |
newExif.projectionType = String(projectionType).toUpperCase(); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just store the value always, regardless if it matches the enum. We can update the enum in the future if we discover a new valid value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newExif.projectionType is a enum. What will happen in case String(projectionType).toUpperCase();
does not exist in this enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The database type is a varchar, right? The entity type should be ProjectionType | string
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only accept valid values we should use pg enum. If we accept other values we should use a varchar and store the raw value (maybe transformed to uppercase). IMO the projection type is just a hint of what valid types are available to be used, but the value is just a string. I don't know if it is possible/easy to use enum in the web and flutter without getting an error for other values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything would be quite a bit easier if you just stored it as a string everywhere in the server codebase, and had the property in the response dto be a string.
You can define the enum in the web to use for your if statements. Happy to discuss more in discord if you want to chat there instead of back and forth here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actualy i liked enum . I would suggested to keep enum | str. I changed it here: a06ee84
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to keep enum | str.
As far as I understood, there are just 2 most popular projection types:equirectangular and cylinder
…into web_panoramas_2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some back and forth when it came to using a projection type enum server-side. In short, the server doesn't even use the value anywhere. The only place it is used currently is in the UI. Everything is a lot simpler if this is stored and treated as a string and the enum exists in the web for this specific panorama case. Javascript isn't typed and can load arbitrary values, but flutter is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR doesn't check the aspect ratio anymore. @dmitry-brazhenko, please update the PR description
🎉 |
Is there a way to add the property projectionType to post upload? I think there might be some issue with the metadata of my original panorama image that it is not showing up as panorama in immich. It would be nice to (force) show them as panorama in immich. |
Initial PR: #3098
In this PR I aded
How it was implemented
Potential further improvements:
Here is thumb that shows a panorama:
Panorama after is opened: