GDevelop-extensions icon indicating copy to clipboard operation
GDevelop-extensions copied to clipboard

New extension: UploadDownloadImageFile

Open github-actions[bot] opened this issue 1 year ago • 17 comments

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

UploadDownloadImageFile.json.zip

github-actions[bot] avatar Dec 27 '23 16:12 github-actions[bot]

Was this extension made with GDevelop? It doesn't have newlines, but extensions exported from GDevelop should be exported with the new lines...

arthuro555 avatar Dec 27 '23 18:12 arthuro555

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.

D8H avatar Dec 28 '23 00:12 D8H

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

RebornOfc avatar Dec 31 '23 15:12 RebornOfc

(Fixed the download file action to allow choosing the name)

!update UploadDownloadImageFile.json.zip

RebornOfc avatar Jan 04 '24 01:01 RebornOfc

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.

github-actions[bot] avatar Jan 04 '24 01:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 04 '24 01:01 github-actions[bot]

Now you can extract a base64 string out of an already existing object. Updated some descriptions.

!update UploadDownloadImageFile.json.zip

RebornOfc avatar Jan 08 '24 04:01 RebornOfc

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.

github-actions[bot] avatar Jan 08 '24 04:01 github-actions[bot]

Added so many things since 2 weeks ago

!update UploadDownloadImageFile.json

RebornOfc avatar Jan 21 '24 20:01 RebornOfc

❗ An internal error has occurred. See logs at https://github.com/GDevelopApp/GDevelop-extensions/actions/runs/7603497732.

github-actions[bot] avatar Jan 21 '24 20:01 github-actions[bot]

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

RebornOfc avatar Jan 26 '24 18:01 RebornOfc

❗ An internal error has occurred. See logs at https://github.com/GDevelopApp/GDevelop-extensions/actions/runs/7672071381.

github-actions[bot] avatar Jan 26 '24 18:01 github-actions[bot]

❗ An internal error has occurred. See logs at https://github.com/GDevelopApp/GDevelop-extensions/actions/runs/7672081300.

github-actions[bot] avatar Jan 26 '24 18:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 26 '24 18:01 github-actions[bot]

✅ Successfully updated the extension.

github-actions[bot] avatar Jan 26 '24 18:01 github-actions[bot]

@RebornOfc Looks like the image variable in the "Upload device image" action doesn't work, it's empty after upload.

jack-ii avatar Aug 20 '24 23:08 jack-ii