# Problem adding custom emojis

**URL:** https://meta.discourse.org/t/problem-adding-custom-emojis/55057
**Category:** Bug
**Created:** [January 2, 2017, 2:59pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057 "2017-01-02T14:59:35Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 2, 2017, 2:59pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/1 "2017-01-02T14:59:35Z")

</div>

We use custom emojis. Some of them are bigger than standard. We use the following CSS hack to display it nicely:

```plaintext
    /* Emoji Style */
    body img.emoji[title^=":_"] {
        width: initial !important;
        height: initial !important;
    }
```

This one, as example: ![](https://global.discourse-cdn.com/meta/original/3X/8/0/80fff4636ee4169a4b4959306a87c70aaf74e33a.gif) (named :\_bigboss:)

Since Beta 10 or 11 (we are on latest: v1.7.0.beta11 +38) adding new oversized emoji, generates this error:

```plaintext
    /var/www/discourse/app/models/optimized_image.rb:110:in `block in ensure_safe_paths!'
    /var/www/discourse/app/models/optimized_image.rb:109:in `each'
    /var/www/discourse/app/models/optimized_image.rb:109:in `ensure_safe_paths!'
    /var/www/discourse/app/models/optimized_image.rb:135:in `resize_instructions_animated'
    /var/www/discourse/app/models/optimized_image.rb:192:in `downsize_instructions_animated'
    /var/www/discourse/app/models/optimized_image.rb:213:in `optimize'
    /var/www/discourse/app/models/optimized_image.rb:205:in `downsize'
    /var/www/discourse/app/jobs/regular/resize_emoji.rb:14:in `execute'
    /var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'
```

  
[code]

hostname dragon-app  
process\_id 110  
application\_version [a481bf048facd5e0c9a896d52f210b450c5a3d08, d8be3e8bb10f02912107803b28a1aa08080c9f81]  
current\_db default  
job Jobs::ResizeEmoji  
problem\_db default  
opts   
path public/uploads/default/\_emoji/\_bigboss.gif  
current\_site\_id default  
[/code]

Other emjoi we added before, are still working without any problems.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 2, 2017, 3:22pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/2 "2017-01-02T15:22:52Z")

</div>

What’s the name of the file you’re uploading? If it has “`:`” in it, just remove them.

---

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 2, 2017, 3:25pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/3 "2017-01-02T15:25:14Z")

</div>

The name of the file is “\_bigboss.gif” - as you can see in the second last line of the backtrace.log  
The error also occurs if I name it “bigboss.gif” or if I try any other oversized emoji.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 2, 2017, 3:26pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/4 "2017-01-02T15:26:49Z")

</div>

I just uploaded the emoji just fine here :\_bigboss: (removed the emoji)

---

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 2, 2017, 3:28pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/5 "2017-01-02T15:28:23Z")

</div>

Yes the upload works. Now wait a few Minutes and have a look at your /logs

---

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 2, 2017, 3:29pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/6 "2017-01-02T15:29:03Z")

</div>

I can also use it, but getting a lot of errors in the log is not good 🙂

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 2, 2017, 3:35pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/7 "2017-01-02T15:35:27Z")

</div>

This broke on last security patch.

The job is being queued with a relative path.

What do you think about this @zogstrip : [FIX: Use full path for emoji resize job by xfalcox · Pull Request #4633 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/4633) ?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 2, 2017, 3:36pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/8 "2017-01-02T15:36:39Z")

</div>

> [@Lutz](#):
>
> Yes the upload works. Now wait a few Minutes and have a look at your /logs

Ok, I did not understand that.

> [@Falco](#):
>
> The job is being queued with a relative path.
> 
> What do you think about this @zogstrip : [FIX: Use full path for emoji resize job by xfalcox · Pull Request #4633 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/4633) ?

Looks good to me 👍

---

<div class="post-metadata">

### Author: ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)
#### Post date: [January 3, 2017, 4:51pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/9 "2017-01-03T16:51:14Z")

</div>

The issue is completely solved. Thanks again, you guys are awesome!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 3, 2017, 5:06pm UTC](https://meta.discourse.org/t/problem-adding-custom-emojis/55057/10 "2017-01-03T17:06:47Z")

</div>


