GDevelop-extensions
GDevelop-extensions copied to clipboard
New extension: UploadDownloadImageFile
Description
Allows the upload of an image from the gallery, from a base64 string, and the download of images.
How to use the extension
Allows the upload of an image from the gallery, from a base64 string, and the download of images.
Content:
- The action Upload image from gallery.
- The action Load a base64 encoded image.
- The action Download object image.
Do note that the object's resource is replaced with the picture, meaning that every object sharing the same resource as the receiver one will also display the picture.
Checklist
- [X] I've followed all of the best practices.
- [X] I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
- [X] I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.
What tier of review do you aim for your extension?
Community (Unreviewed)
Example file
UploadDownloadImageFileExample.zip
Extension file
Was this extension made with GDevelop? It doesn't have newlines, but extensions exported from GDevelop should be exported with the new lines...
Was this extension made with GDevelop? It doesn't have newlines, but extensions exported from GDevelop should be exported with the new lines...
The web version doesn't have the right parameters and it exports without any indentation.
Was this extension made with GDevelop? It doesn't have newlines, but extensions exported from GDevelop should be exported with the new lines...
Yes it was made in GDevelop
(Fixed the download file action to allow choosing the name)
!update UploadDownloadImageFile.json.zip
Can't update the extension, as it doesn't pass automatic tests:
❌ 1 Error found in extension 'UploadDownloadImageFile':
⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'UploadDownloadImageFile':
{
allowedProperties: [
'makeUuid', 'rgbToHex',
'rgbOrHexToRGBColor', 'rgbToHexNumber',
'hexNumberToRGB', 'hexToRGBColor',
'copyArray', 'staticArray',
'staticArray2', 'staticObject',
'toDegrees', 'toRad',
'random', 'randomFloat',
'randomFloatInRange', 'randomInRange',
'randomWithStep', 'evtTools',
'Variable', 'RuntimeObject',
'Logger'
],
disallowedProperty: '_ExtensionUploadedImages',
objectName: 'gdjs'
}
❌ 1 Error found in extensions - please fix it before generating the registry.
Can't update the extension, as it doesn't pass automatic tests:
❌ 1 Error found in extension 'UploadDownloadImageFile':
⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'UploadDownloadImageFile':
{
allowedProperties: [
'makeUuid', 'rgbToHex',
'rgbOrHexToRGBColor', 'rgbToHexNumber',
'hexNumberToRGB', 'hexToRGBColor',
'copyArray', 'staticArray',
'staticArray2', 'staticObject',
'toDegrees', 'toRad',
'random', 'randomFloat',
'randomFloatInRange', 'randomInRange',
'randomWithStep', 'evtTools',
'Variable', 'RuntimeObject',
'Logger'
],
disallowedProperty: '_ExtensionUploadedImages',
objectName: 'gdjs'
}
❌ 1 Error found in extensions - please fix it before generating the registry.
Now you can extract a base64 string out of an already existing object. Updated some descriptions.
!update UploadDownloadImageFile.json.zip
Can't update the extension, as it doesn't pass automatic tests:
❌ 1 Error found in extension 'UploadDownloadImageFile':
⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'UploadDownloadImageFile':
{
allowedProperties: [
'makeUuid', 'rgbToHex',
'rgbOrHexToRGBColor', 'rgbToHexNumber',
'hexNumberToRGB', 'hexToRGBColor',
'copyArray', 'staticArray',
'staticArray2', 'staticObject',
'toDegrees', 'toRad',
'random', 'randomFloat',
'randomFloatInRange', 'randomInRange',
'randomWithStep', 'evtTools',
'Variable', 'RuntimeObject',
'Logger'
],
disallowedProperty: '_ExtensionUploadedImages',
objectName: 'gdjs'
}
❌ 1 Error found in extensions - please fix it before generating the registry.
❗ An internal error has occurred. See logs at https://github.com/GDevelopApp/GDevelop-extensions/actions/runs/7603497732.
The extension is ready, honestly the only thing missing is to make "Download file" work on mobile devices, here is the final build (ready to be implemented as community extension):
Note: I removed the namespace 'gdjs._ExtensionUploadedImages' because I found proper methods.
!update UploadDownloadImageFile.json
Oh, I forgot I have to make it a zip file
❗ An internal error has occurred. See logs at https://github.com/GDevelopApp/GDevelop-extensions/actions/runs/7672071381.
❗ An internal error has occurred. See logs at https://github.com/GDevelopApp/GDevelop-extensions/actions/runs/7672081300.
!update UploadDownloadImageFile.json.zip
Can't update the extension, as it doesn't pass automatic tests:
❌ 2 Errors found in extension 'UploadDownloadImageFile':
⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'WriteBase64Image parameter 'Variable' has a dot, but it is forbidden there!
⟶ ❌ (🔧) [Dots in sentences]: Field 'description' of the function 'WriteImage parameter 'Variable' has a dot, but it is forbidden there!
❌ 2 Errors found in extensions - please fix them before generating the registry.
✅ Successfully updated the extension.
@RebornOfc Looks like the image variable in the "Upload device image" action doesn't work, it's empty after upload.