# Allow user to specify size of image via attributes

**URL:** https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130
**Category:** Feature
**Created:** [3월 9, 2015, 3:40오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130 "2015-03-09T15:40:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![RaceProUK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raceprouk/32/115844_2.png) [@RaceProUK](https://meta.discourse.org/u/RaceProUK)
#### Post date: [3월 9, 2015, 3:40오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/1 "2015-03-09T15:40:25Z")

</div>

Originally reported over at TDWTF:

> **[What the Daily WTF?](https://what.thedailywtf.com/login)**

Don’t know how easy this one is to fix, and to be fair, I am rather misusing ninja edits by way of automation, but I figured it’s still worth reporting.

Steps to reproduce:

1. Start writing a post and add an image to it
2. Change the `width`/`height` attributes of the image (I make them smaller, and usually remove one of the attributes too)
3. Submit the post
4. Wait for the bot that automates some actions for you to ninja edit the post (for me, it’s usually within a few seconds)

Result: The image expands to the size the upload set it to.

Weirdly, if you ninja-edit manually, the issue doesn’t occur; it’s only when it’s done ‘behind the scenes’ the issue rears its head.

* * *

Not sure how well-known the term `ninja edit` is here; happy to explain if required 😉

---

<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: [3월 9, 2015, 3:42오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/2 "2015-03-09T15:42:27Z")

</div>

What does your bot do?

---

<div class="post-metadata">

### Author: ![RaceProUK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raceprouk/32/115844_2.png) [@RaceProUK](https://meta.discourse.org/u/RaceProUK)
#### Post date: [3월 9, 2015, 3:45오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/3 "2015-03-09T15:45:00Z")

</div>

Not a lot really; the feature that triggers the issue is something I wrote to substitute emoji like ☺ for Discourse emoji like 😄. It’s basically for when I’m posting from mobile, so I don’t have to remember all the Discourse codes (the auto-complete doesn’t show on mobile, not for me anyway).

---

<div class="post-metadata">

### Author: ![accalia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/accalia/32/48626_2.png) [@accalia](https://meta.discourse.org/u/accalia)
#### Post date: [3월 9, 2015, 3:58오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/4 "2015-03-09T15:58:03Z")

</div>

as @RaceProUK said, not much.

here’s the implementation with the relevant parts highlighted.

[https://github.com/AccaliaDeElementia/SockBot/blob/master/sock\_modules/emoji.js#L121-L135](https://github.com/AccaliaDeElementia/SockBot/blob/master/sock_modules/emoji.js#L121-L135)

Basically it follows /posts.json, looking for posts owned by the user the bot is operating on, that haven’t been touched by the bot before. then does a find/replace on a set of emoji, adds a hidden footer and fires off an edit post.

---

<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: [3월 9, 2015, 9:14오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/5 "2015-03-09T21:14:54Z")

</div>

> [@RaceProUK](#):
>
> something I wrote to substitute emoji like ☺ for Discourse emoji like 😄. It’s basically for when I’m posting from mobile, so I don’t have to remember all the Discourse codes

Why don’t you propose this as a feature? Seems like a good idea to me, and can be done server side.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [3월 9, 2015, 9:31오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/6 "2015-03-09T21:31:24Z")

</div>

Emojione have some mappings for unicode → Emoji in thier js file, I proposed this before it is not a trivial change, that said would be really awesome on mobile

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 12, 2015, 8:18오전 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/7 "2015-08-12T08:18:35Z")

</div>

The old title here was really confusing me cause we have this (which is planned):

> [@Auto-replace emoji like smiling\_face with Discourse codes](https://meta.discourse.org/t/auto-replace-emoji-like-with-discourse-codes/26155):
>
> Over on TDWTF, I’ve been using a bot to automatically replace Unicode emoji like slight_smile with Discourse emoji codes like smile; it’s useful when posting from mobile. @codinghorror suggests it could be made a Discourse feature; it never occurred to me before, but it does sound like it’d be useful. That way it could also work in PMs, which is something I haven’t got working in my bot yet.

I think this issue is about allowing users to cleanly specify width and height of an image and having it “take”. We may get to something like this if we had a “wizardy” thing in preview that allowed you to size images.

---

<div class="post-metadata">

### Author: ![RaceProUK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raceprouk/32/115844_2.png) [@RaceProUK](https://meta.discourse.org/u/RaceProUK)
#### Post date: [8월 12, 2015, 8:26오후 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/8 "2015-08-12T20:26:41Z")

</div>

It wasn’t, but that does sound like a useful thing to have 😄

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [12월 4, 2025, 11:35오전 UTC](https://meta.discourse.org/t/allow-user-to-specify-size-of-image-via-attributes/26130/9 "2025-12-04T11:35:45Z")

</div>


