---
title: "Comment by Boni on \"Supabase Storage CDN and Transformation with Serverless function (Unofficial)\" | Hashnode"
description: "Hey Zernonia, Thanks for the tutorial. I notice there was a problem when using this for jpeg images. After the image resize the image&#39;s metadata is lost so"
url: "https://hashnode.com/posts/supabase-storage-cdn-and-transformation-with-serverless-function-unofficial/613c167e22b7a41dfe5fb3c1/comment/62526d8f92d73e7055c19131"
---

[Discussion](https://hashnode.com/posts/supabase-storage-cdn-and-transformation-with-serverless-function-unofficial/613c167e22b7a41dfe5fb3c1)

Comment [Supabase Storage CDN and Transformation with Serverless function (Unofficial)](https://hashnode.com/posts/supabase-storage-cdn-and-transformation-with-serverless-function-unofficial/613c167e22b7a41dfe5fb3c1)

[Boni](https://hashnode.com/@gossterrible)

[Apr 10, 2022](https://hashnode.com/posts/supabase-storage-cdn-and-transformation-with-serverless-function-unofficial/613c167e22b7a41dfe5fb3c1/comment/62526d8f92d73e7055c19131)

Hey Zernonia, Thanks for the tutorial. I notice there was a problem when using this for jpeg images. After the image resize the image's metadata is lost so the original image orientation is lost as well since it's contained in the metadata.

The solution to this will be to add this

```
.withMetadata()
```

before

```
.toBuffer()
```

Happy coding everyone :)
