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

As empty string needs to considered as transparent background color, modified value to null #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class SmartEditorComponent implements OnInit{
const maskFile = this.base64ToFile(maskUrl, 'mask.png');
const aiOutput = StabilityAiModelMagicEraser(file, maskFile);
aiOutput.then((result:any) => {
this.imageEditorObj.open(result, false, {backgroundColor: '' });
this.imageEditorObj.open(result, false, {backgroundColor: null });
setTimeout(() => {
hideSpinner(this.imageEditorObj.element);
this.wrapperDiv.style.opacity = '1';
Expand Down
2 changes: 1 addition & 1 deletion react/src/ai-components/image-editor/image-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function ImageEditor() {
const maskFile = base64ToFile(maskUrl, 'mask.png');
const aiOutput = StabilityAiModelMagicEraser(file, maskFile);
aiOutput.then((result: any) => {
imageEditorObj.open(result, false, { backgroundColor: '' });
imageEditorObj.open(result, false, { backgroundColor: null });
setTimeout(() => {
hideSpinner(imageEditorObj.element);
wrapperDiv.style.opacity = '1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ document.getElementById('eraseBtn')!.onclick = (): void => {
const maskFile = base64ToFile(maskUrl, 'mask.png');
const aiOutput = StabilityAiModelMagicEraser(file, maskFile);
aiOutput.then((result:any) => {
imageEditorObj.open(result, false, { backgroundColor: '' });
imageEditorObj.open(result, false, { backgroundColor: null });
setTimeout(() => {
hideSpinner(imageEditorObj.element);
wrapperDiv.style.opacity = '1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default {
const maskFile = this.base64ToFile(maskUrl, 'mask.png');
const aiOutput = StabilityAiModelMagicEraser(file, maskFile);
aiOutput.then((result) => {
imageEditorObj.open(result, false, { backgroundColor: '' });
imageEditorObj.open(result, false, { backgroundColor: null });
setTimeout(() => {
hideSpinner(imageEditorObj.element);
wrapperDiv.style.opacity = '1';
Expand Down