# Device setAlbumArtImage

**URL:** <https://community.homey.app/t/device-setalbumartimage/6652>\
**Category:** Developers\
**Tags:** app\
**Created:** [January 12, 2019, 10:11am UTC](https://community.homey.app/t/device-setalbumartimage/6652 "2019-01-12T10:11:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxmudjon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/maxmudjon/32/1163_2.png) [@Maxmudjon](https://community.homey.app/u/Maxmudjon)\
**Post date:** [January 12, 2019, 10:11am UTC](https://community.homey.app/t/device-setalbumartimage/6652/1 "2019-01-12T10:11:37Z")

</div>

in device.js

```auto
const avtoRadioLogo = new Homey.Image('png');
avtoRadioLogo.setPath('./assets/images/radio/logos/avtoradio.png');
avtoRadioLogo.register().then(result => console.log("REGISTER ", result)).catch(console.error);

```

console.log(avtoRadioLogo)

```auto
Image {
  format: 'png',
  id: '65f4cfbd-c135-4d53-98a0-7e25696b7697',
  __client: { emit: [Function: bound__onImageEmit] },
  _type: 'path',
  _source: './assets/images/radio/logos/avtoradio.png' }

```

this.setAlbumArtImage(avtoRadioLogo, true)

not worked

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 12, 2019, 10:15am UTC](https://community.homey.app/t/device-setalbumartimage/6652/2 "2019-01-12T10:15:23Z")

</div>

Where/when exactly do you call `this.setAlbumArtImage()`? Also, what does “not worked” mean? Do you get errors?

---

<div class="post-metadata">

**Author:** ![Maxmudjon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/maxmudjon/32/1163_2.png) [@Maxmudjon](https://community.homey.app/u/Maxmudjon)\
**Post date:** [January 12, 2019, 10:18am UTC](https://community.homey.app/t/device-setalbumartimage/6652/3 "2019-01-12T10:18:54Z")

</div>

I want to change the images for the album  
does not work this.setAlbumArtImage(autoRadioLogo, true)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 12, 2019, 10:19am UTC](https://community.homey.app/t/device-setalbumartimage/6652/4 "2019-01-12T10:19:32Z")

</div>

Do you have your code online somewhere?

---

<div class="post-metadata">

**Author:** ![Maxmudjon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/maxmudjon/32/1163_2.png) [@Maxmudjon](https://community.homey.app/u/Maxmudjon)\
**Post date:** [January 12, 2019, 10:21am UTC](https://community.homey.app/t/device-setalbumartimage/6652/5 "2019-01-12T10:21:00Z")

</div>

> <https://github.com/Maxmudjon/images/blob/master/test>

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 12, 2019, 10:31am UTC](https://community.homey.app/t/device-setalbumartimage/6652/6 "2019-01-12T10:31:43Z")

</div>

I’m not quite sure if you can register an image there (at the top of your module), but I’ve never worked with images before. Perhaps putting it inside of `onInit` is better:

```
async onInit() {
  ...
 this.avtoRadioLogo = new Homey.Image('png');
 await this.avtoRadioLogo.register().then(result => console.log("REGISTER ", result)).catch(console.error);
}

```

(and use `this.avtoRadioLogo` instead of `avtoRadioLogo` when you need to reference it)

Also, this seems strange:

```
that.setAlbumArtImage(avtoRadioLogo, true)

```

The second argument for `setAlbumArtImage` should be an (optional) callback, not a boolean. I have no idea if passing a boolean will make it fail or not, but either pass a function, or nothing at all:

```
that.setAlbumArtImage(avtoRadioLogo)
```

---

<div class="post-metadata">

**Author:** ![Maxmudjon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/maxmudjon/32/1163_2.png) [@Maxmudjon](https://community.homey.app/u/Maxmudjon)\
**Post date:** [January 12, 2019, 10:42am UTC](https://community.homey.app/t/device-setalbumartimage/6652/7 "2019-01-12T10:42:36Z")

</div>

> [@robertklep](#):
>
> this.avtoRadioLogo = new Homey.Image(‘png’); await this.avtoRadioLogo.register().then(result =\> console.log("REGISTER ", result)).catch(console.error);

 ![photo_2019-01-12_15-41-56](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/858a8eadceeca331cef15c695c2f7eaff592c77c.jpeg)

---

<div class="post-metadata">

**Author:** ![Maxmudjon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/maxmudjon/32/1163_2.png) [@Maxmudjon](https://community.homey.app/u/Maxmudjon)\
**Post date:** [January 12, 2019, 11:16am UTC](https://community.homey.app/t/device-setalbumartimage/6652/8 "2019-01-12T11:16:20Z")

</div>

it’s decided

async onInit() {  
this.image = new Homey.Image(‘jpg’);  
this.image.setUrl(null);  
this.image.register()  
.then(() =\> {  
return this.setAlbumArtImage(this.image);  
})  
.catch(this.error);  
}

on some function

this.image.setUrl(‘[https://www.avtoradio.ru/design/images/site-design/avtoradio-logo.png](https://www.avtoradio.ru/design/images/site-design/avtoradio-logo.png)’);  
this.image.update();
