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

Rotation values lost? Postform to Posted #47

Open
TAXI4L opened this issue Mar 19, 2024 · 2 comments
Open

Rotation values lost? Postform to Posted #47

TAXI4L opened this issue Mar 19, 2024 · 2 comments

Comments

@TAXI4L
Copy link

TAXI4L commented Mar 19, 2024

Hello

Problem solving something with image rotation. When a user creates a post with a photo the preview window that shows the photo is working great. ondrop / dropzone. FileUplaoder. However if the photo has rotation / uploaded from mobile it will loose whatever is working in the preview. PostForm onSubmit. The images are correct in the Appwrite DB preview. Something is ignoring their rotation or loosing that rotation when it pulls them back down and draws them in the social media app (doesn't matter if it's a grid or a profile picture, etc). I've been working on it for days, BlueImp / EXIF / etc and haven't been able to make a change to the rotation that carries over to the saved / posted file.

Any hints or tips to help me look at how to solve this would be greatly appreciated. And thank you. Your tutorial and source code really helped me a lot. Feel free to check out what you help me build.

Nupperson.com

and.... help! :)

@TAXI4L
Copy link
Author

TAXI4L commented Mar 20, 2024

I think I solved it! Finally!!! Yay. Went through the appwrite info and found some details on images are stored which then brought me back to 'getFilePreview' - just needed to include the rotation value there. Solved.

in api.ts update getFilePreview.

Here is my updated function:

export function getFilePreview(fileId: string) {
try {
const fileUrl = storage.getFilePreview(
appwriteConfig.storageId,
fileId,
1800, // width, will be resized using this value.
0, // height, ignored when 0
'center', // crop center
60, // some compression
5, // border width
'CDCA30', // border color
15, // border radius
1, // full opacity
0, // no rotation
'FFFFFF', // background color
'jpg' // output jpg format
);

Help closed. I guess this can be left here in if you want it.... in case others run into mobile upload image rotation issues :)

@anantiikenna
Copy link

if your file is GIF image or any. First make it acceptable by appwrite and Second there is a section in File Upload function ask for acceptable file in your shared Folder locate this code

 accept: {
      'imgae/*': ['.png', '.jpeg', '.jpg', '.svg']
    }

and add your image format.

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

No branches or pull requests

2 participants