Skip to content
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

Aladin#getViewImageBuffer support #165

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

Xen0Xys
Copy link
Contributor

@Xen0Xys Xen0Xys commented May 30, 2024

For testing purposes, it il possible to save a PNG ArrayBuffer with the following code :

const save = function(arrayBuffer, filename) {
    const blob = new Blob([arrayBuffer], { type: 'image/png' });
    const url = URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.href = url;
    a.download = filename;
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
    URL.revokeObjectURL(url);
}

Copy link
Collaborator

@bmatthieu3 bmatthieu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it is good to merge :)

src/js/View.js Outdated Show resolved Hide resolved
src/js/Aladin.js Outdated Show resolved Hide resolved
src/js/Aladin.js Outdated Show resolved Hide resolved
@bmatthieu3
Copy link
Collaborator

Maybe also I think it would be good to add some jsdoc for Aladin.prototype.getViewDataURL and Aladin.prototype.getViewArrayBuffer.
Even maybe do a new method call Aladin.prototype.getView(dataType) with datatype that can be: 'blob', 'url', 'arrayBuffer'

@Xen0Xys Xen0Xys force-pushed the feature/png-recovery branch from 3571741 to 76df6f1 Compare June 12, 2024 07:04
@Xen0Xys
Copy link
Contributor Author

Xen0Xys commented Jun 12, 2024

Maybe also I think it would be good to add some jsdoc for Aladin.prototype.getViewDataURL and Aladin.prototype.getViewArrayBuffer. Even maybe do a new method call Aladin.prototype.getView(dataType) with datatype that can be: 'blob', 'url', 'arrayBuffer'

Do you mean a function to replace getCanvasArrayBuffer and getCanvasDataURL, or a function that calls these two?

@Xen0Xys Xen0Xys requested a review from bmatthieu3 June 12, 2024 08:44
@Xen0Xys Xen0Xys force-pushed the feature/png-recovery branch from 572fbc0 to 8cda872 Compare June 13, 2024 12:45
src/js/Aladin.js Outdated Show resolved Hide resolved
@Xen0Xys Xen0Xys force-pushed the feature/png-recovery branch from daa0958 to 7eda61f Compare June 14, 2024 08:05
@bmatthieu3 bmatthieu3 merged commit 1065dbe into cds-astro:develop Jun 14, 2024
2 checks passed
@Xen0Xys Xen0Xys deleted the feature/png-recovery branch July 16, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants