Closed garymh closed 8 months ago
Hi @garymh
I'll try to figure out what's causing the issue. Could you give me the Alfred logs ?
Sure!
[08:58:54.871] Logging Started...
[08:59:00.788] Emoji Wine[Script Filter] Queuing argument '(null)'
[08:59:01.084] Emoji Wine[Script Filter] Script with argv '(null)' finished
[08:59:01.089] Emoji Wine[Script Filter] {"items": [{"title": "Refresh the API", "subtitle": "Press \u23ce to grab emoji data with language : \ud83c\uddec\ud83c\udde7 English", "arg": "_api", "icon": {"path": "icons/sync.webp"}}, {"title": "Tags", "subtitle": "Create, modify or remove tags for \ud83c\uddec\ud83c\udde7 English", "arg": "_rerun;;1;;", "icon": {"path": "icons/tag.webp"}}, {"title": "API information", "subtitle": "Last update : 26-07-2023 19:29:31 \u01c0 3664 Emojis \u01c0 \ud83c\uddec\ud83c\udde7 English", "valid": false, "icon": {"path": "icons/info.webp"}}]}
[08:59:03.322] Emoji Wine[Script Filter] Processing complete
[08:59:03.326] Emoji Wine[Script Filter] Passing output '_rerun;;1;;' to Split Arg
[08:59:03.327] Emoji Wine[Split Arg] Processing complete
[08:59:03.327] Emoji Wine[Split Arg] Passing output '_rerun;;1;;' to Conditional
[08:59:03.328] Emoji Wine[Conditional] Processing complete
[08:59:03.328] Emoji Wine[Conditional] Passing output '_rerun;;1;;' to Call External Trigger
[08:59:03.329] Emoji Wine[External] Processing complete
[08:59:03.329] Emoji Wine[External] Passing output '_rerun;;1;;' to Arg and Vars
[08:59:03.330] Emoji Wine[Arg and Vars] Processing complete
[08:59:03.330] Emoji Wine[Arg and Vars] Passing output '' to Script Filter
[08:59:03.372] Emoji Wine[Script Filter] Queuing argument '(null)'
really strange, could you confirm me that you have version 1.3.0 of the workflow ?
When I trigger harvest :
[21:55:42.438] Logging Started...
[21:55:46.690] Emoji Wine[Script Filter] Queuing argument '(null)'
[21:55:46.878] Emoji Wine[Script Filter] Script with argv '(null)' finished
[21:55:46.879] Emoji Wine[Script Filter] {"items": [{"title": "Refresh the API", "subtitle": "Press \u23ce to grab emoji data with language : \ud83c\uddec\ud83c\udde7 English", "arg": "_api", "icon": {"path": "icons/sync.webp"}}, {"title": "Tags", "subtitle": "Create, modify or remove tags for \ud83c\uddec\ud83c\udde7 English", "arg": "_rerun;;1;;", "icon": {"path": "icons/tag.webp"}}, {"title": "API information", "subtitle": "Last update : 10-02-2024 18:16:56 \u01c0 3782 Emojis \u01c0 \ud83c\uddec\ud83c\udde7 English", "valid": false, "icon": {"path": "icons/info.webp"}}]}
[21:55:48.515] Emoji Wine[Script Filter] Processing complete
[21:55:48.517] Emoji Wine[Script Filter] Passing output '_rerun;;1;;' to Split Arg
[21:55:48.518] Emoji Wine[Split Arg] Processing complete
[21:55:48.520] Emoji Wine[Split Arg] Passing output '_rerun;;1;;' to Conditional
[21:55:48.522] Emoji Wine[Conditional] Processing complete
[21:55:48.524] Emoji Wine[Conditional] Passing output '_rerun;;1;;' to Call External Trigger
[21:55:48.525] Emoji Wine[External] Processing complete
[21:55:48.527] Emoji Wine[External] Passing output '_rerun;;1;;' to Arg and Vars
[21:55:48.543] Emoji Wine[Arg and Vars] Processing complete
[21:55:48.545] Emoji Wine[Arg and Vars] Passing output '' to Script Filter
[21:55:48.547] Emoji Wine[Script Filter] Queuing argument '(null)'
[21:55:48.759] Emoji Wine[Script Filter] Script with argv '(null)' finished
[21:55:48.766] Emoji Wine[Script Filter] {"items": [{"title": "Return", "subtitle": "Back to previous state", "arg": "_rerun;;0;;", "icon": {"path": "icons/return.webp"}}, {"title": "Add a new tag", "subtitle": "Create a new tag and assign it to emojis", "arg": "_tags;new;;;_rerun\u01c0\u01c01\u01c0\u01c0", "icon": {"path": "icons/new.webp"}}, {"title": "Delete a tag", "subtitle": "Erase a tag from the list below", "arg": "_rerun;delete;2;;", "icon": {"path": "icons/delete.webp"}}]}
I am seeing this :
From there you can create tags and associate it to emojis.
Oh weird... hmm. Yep, I have version 1.3.0. Something might be configured differently in Alfred... or in Python?
could you check that you have tags-en.json
file here : ~/Library/Application Support/Alfred/Workflow Data/com.benjamino.emoji_wine
and also please check for any error in the workflow logs located here ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.benjamino.emoji_wine
Yep- I have tags-en.json
:
~/L/Application Support/Alfred/Workflow Data/com.benjamino.emoji_wine
β― cat tags-en.json
1 []
My emoji_wine.log
file is:
1 2024-02-26 12:36:07,687 - ERROR - unimplemented feature
2 2024-02-26 20:20:22,459 - ERROR - unimplemented feature
3 2024-02-26 20:21:29,685 - ERROR - unimplemented feature
4 2024-02-26 20:24:12,546 - ERROR - unimplemented feature
5 2024-02-26 20:42:28,073 - ERROR - unimplemented feature
Could you try to refresh your API ?
Weirdly, this started happening - I used to be able to get the initial list of emoji
Yes I think something is not configured correctly but I can't really know what's happening. How did you install python ? Could you also give me the new logs ? Could you maybe try to reinstall the workflow (just to make sure). I'll try my best to debug.
I installed Python via homebrew. I uninstalled it via command line and then reinstalled it through Alfred, but nothing. I reinstalled the workflow several times after clearing out ~/Library/Application Support/Alfred/Workflow Data/com.benjamino.emoji_wine
and ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.benjamino.emoji_wine
The only log I get is the ERROR - unimplemented feature
line...
It must be something with convert_emoji_to_png
- I commented out the call on line 94 of api.py
and everything worked perfectly. π€
Ok then. Could you confirm me that you don't have any emojis icons when you trigger wine
? There might be something with pillow but as you seems to have the latest version π€. Could you also check that you have the emoji font here /System/Library/Fonts/Apple Color Emoji.ttc
. I put that raw meaning I expect it's always available under this path, but maybe on newer Macs (I have an intel chip) the path is different ?
Some of the emoji icons appear, I'm not sure if they're sorted but it stops at "person facing right".
Yep- emoji font is in the same place. I am on an M1 though
mhh kind of weird. Is it possible that the emojis without icons are emojis from unicode 15.1 ? There aren't available yet but the unicode is already in the api since end of 2023 (see this article). But it shouldn't be a problem, for me it looks like this:
Could you delete these elements from the cache folder ~/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.benjamino.emoji_wine
before refreshing the API ?
EDIT : Could you try this python script ?
from PIL import Image, ImageDraw, ImageFont
def convert_emoji_to_png(emoji):
image_size = (74 , 74) # set image size
image = Image.new("RGBA", image_size, (0, 0, 0, 0)) # Set transparent background
font_size = 64 # Adjusted font size
font_path = "/System/Library/Fonts/Apple Color Emoji.ttc"
font = ImageFont.truetype(font_path, font_size, encoding='unic')
draw_position = (int((image_size[0] - font_size) / 2), int((image_size[1] - font_size) / 2))
draw = ImageDraw.Draw(image)
draw.text(draw_position, emoji, font=font, embedded_color=True)
image.show()
try:
convert_emoji_to_png("πΆββ‘οΈ")
except Exception as e:
print(e)
it should render this
Same result after dumping the cache π
Oh, but the python script did:
β― python3 test.py
unimplemented feature
it possible that the emojis without icons are emojis from unicode 15.1
I think you might be on to something! π works but πΆββ‘οΈdoes not. I wonder if it's because there's a modifier on that one?
I'm not sure how emoji works, but is there an emoji + skin tone modifier in Unicode?
I can fix that by just ignoring emojis that fails to be converted into images, or assign them a default image. Also, is there any improvement in the tags section (that was the original subject π)?
Yes some of the codes can be "merged" as one emoji (π + π» = ππ», see here). When the Unicode consortium approved an emoji, each platform (Google, Facebook, Apple) can integrate these codes with a design. Note that the design can change over the years but not the codes.
What I still find weird is : why the behavior is different ? Maybe we can create a GitHub issue in the pillow repo. I can do that if you can provide :
I can fix that by just ignoring emojis that fails to be converted into images, or assign them a default image. Also, is there any improvement in the tags section (that was the original subject π)?
Yep! Disabling the line here let me run everything correctly. Definitely seemed to be a unicode hangup.
What I still find weird is : why the behavior is different ? Maybe we can create a GitHub issue in the pillow repo. I can do that if you can provide :
Yeah, that's very strange. I'm wondering if macOS changed something recently too. Here's my info:
Python 3.12.2 pillow stable 10.2.0 macOS 14.4 Apple M1 Max
@garymh it should be fix in the v1.4.0. Emojis that fails to be converted should have this icon :
Awesome!! Thanks for the help, Benjamin!!
Hi - this might be a dumb question, but I'm a little confused on how you enter the tag section. Typing the
harvest
keyword brings up:but after that, hitting
return
on the Tags section just closes the Alfred window. Typing any arguments (harvest tag
) just goes to my default search...I'm using Python 3.12.2 and pillow 10.2.0_1