-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
New docker image for version of directus with sharp0.32.5 installed #19696
Comments
Here is the issue, that I faced using |
#19658 updated the sharp dependency which will then be available to you in the next release. Can't give you an exact date but you could just build your own version for the meanwhile and switch back to our image once its released. A custom extension is also a great choice. See the extension-docs. |
@DanielBiegler, thank you for the quick response! Do you mean to build docker image by my own? Also, I didn't get how to use another version of Sharp in the Directus extension. Can you please clarify? |
The new sharp version already got merged into our main branch which means you can clone the repository and build the image yourself, yes. See our Dockerfile. Then you could replace the image in your docker-compose to use your own new image. You could also build the project for running locally. Regarding extensions you can add the sharp dependency and use it wherever you need it. (Hooks, Operations, ...) |
Ok, thank you for your help! Have a nice day! |
@DanielBiegler could you check it, please? Is everything correct? |
What does your package.json of the extension look like? Did you install sharp? |
@DanielBiegler here is my package.json {
"name": "directus-extension-do",
"version": "1.0.0",
"type": "module",
"dependencies": {
"@directus/api": "^13.0.0",
"icc": "3.0.0",
"pino": "^8.14.1",
"sharp": "0.32.5"
},
"directus:extension": {
"host": "^10.1.7",
"type": "bundle",
"path": {
"app": "../extensions/directus-extension-do/dist/app.js",
"api": "../extensions/directus-extension-do/dist/api.js"
},
"entries": [
{
"type": "hook",
"name": "locations-json-to-db",
"source": "src/locations/json-to-db/index.ts"
},
{
"type": "interface",
"name": "locations-autocomplete-interface",
"source": "src/locations/autocomplete-interface/index.ts"
},
{
"type": "hook",
"name": "locations-save-locations-to-related-fields",
"source": "src/locations/save-locations-to-related-fields/index.ts"
},
{
"type": "endpoint",
"name": "impressions",
"source": "src/impressions/index.ts"
},
{
"type": "interface",
"name": "digital-original-input",
"source": "src/interfaces/digital-original-input/index.ts"
},
{
"type": "endpoint",
"name": "api",
"source": "src/api/index.ts"
},
{
"type": "hook",
"name": "do-tiles",
"source": "src/do-tiles/index.ts"
}
]
},
"description": "Please enter a description for your extension",
"icon": "extension",
"keywords": [
"directus",
"directus-extension",
"directus-custom-bundle"
],
"scripts": {
"build": "directus-extension build",
"dev": "directus-extension build -w --no-minify",
"link": "directus-extension link",
"add": "directus-extension add"
},
"devDependencies": {
"@directus/extensions-sdk": "10.1.7",
"@types/node": "^20.6.2",
"typescript": "^5.2.2",
"vue": "^3.3.4"
}
} Also, here is the result of directus-extension-do@1.0.0 /Users/insomnia.exe/Workspace/digitaloriginal/do-directus-develop/do-extensions
├─┬ @directus/api@13.0.0
│ └── sharp@0.32.1
└── sharp@0.32.5 |
Also, when I am using image import fs from 'fs/promises';
async function checkSharpVersion() {
const dirs = await fs.readdir('node_modules');
for (const dir of dirs) {
try {
console.info("Checking '" + dir + "'");
if (dir !== 'sharp') continue;
const file = 'node_modules/' + dir + '/package.json';
const json = JSON.parse(await fs.readFile(file, 'utf-8'));
const name = json.name;
const version = json.version;
console.info("Found '" + name + "' version " + version + ' in ' + file);
console.log(name + ': ' + version);
} catch (err) {}
}
} and here is the output from the console directus-do | Checking 'sharp'
directus-do | Found 'sharp' version 0.32.1 in node_modules/sharp/package.json
directus-do | sharp: 0.32.1 |
Hey @AndriyAntonenko 👋 Please note that |
@paescuj thanks for your answer. I will wait for it. My application require this update) |
Describe the Improvement
Issue Description
I'm currently working on creating a Directus extension (hook) to split some of my images into tiles. To achieve this, I'm trying to use the
sharp
library, which is already a part of Directus API. My current version of Directus is10.6.1
, and it is usingsharp@0.32.1
. Unfortunately, this version ofsharp
does not support tile splitting properly, which is essential for my project.I noticed that a new version of
sharp@0.32.5
has been released, which addresses the issue I'm facing. However, I need a Docker image for this new version to integrate it into my environment.Question
Could you please provide an estimate of when the new Docker image with
sharp@0.32.5
will be released? This information would be incredibly helpful for planning my project.Thank you for your assistance!
The text was updated successfully, but these errors were encountered: