You can actually use the Appwrite storage service π
It provides image resizing
Wait, really?
We do have basic image manipulation
Requires these for alpine:
sudo apk add tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev \
libxcb-dev libpng-dev
ya, but the odd thing is the build worked fine
Unfortunately that isn't something we can do right now, but we're talking about it internally I think
π€ Hmmm
It's only JPEG that needs some of these external dependencies
So instead of using getFileDownload i have to use getFilePreview passing the required size? What are the downsides? What If I have images bigger than 10MB?
There shouldn't be many if it's under 10MB. If it's over 10MB, it will be more of an issue, but rarely do you get JPGs larger than 10MB.
Maybe you can try a different runtime like Java?
Python is weird because C-Python uses so many system packages.
π€£ And all the image/video manipulation packages are just C-Python wrappers, basically
@Steven Should we consider distributing a heavier python runtime, or allow them to install other dependencies?
[SOLVED] Cloud Function breaks when resizing jpg image
Is this something that Matej is still thinking about?
I am a big Python user, and I think it's one of those quirks of Python we need to be aware of, which is the heavy reliance on lots of linux packages
ya i think we plan to add customizable build steps in the future
Is the resized image cached? Or does it have to resize it every time I use it?
yes, it is cached
Awsome
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...