glutanimate / puppy-reinforcement

Puppy Reinforcement add-on for Anki
https://ankiweb.net/shared/info/1722658993
Other
15 stars 9 forks source link

[Puppy Reinforcement] alterations to images folder break image display on Windows #4

Closed usnish closed 4 years ago

usnish commented 6 years ago

Hi! Have been messing around with the images folder, and have been able to remove / drop in any new JPG images on MacOS, but on Windows any alterations (including removing some of the existing puppy photos) have left the add-on non-functional (with the desired image being replaced by a white placeholder image).

Have tried re-starting Anki, deleting and re-downloading the plugin, and all, to no avail. Any idea what might be going on?

28207643_10210315437105934_279507565_o

glutanimate commented 6 years ago

Mmh, very weird. Are you still experiencing this? If so, you could try removing all remaining add-on files by going into Anki's add-on directory and removing both the "puppy_reinforcment" folder and the "Puppy Reinforcement.py" / "Puppy Reinforcement.pyc" files. Anki will only delete the python files when removing an add-on, so the remaining data might be causing the issues to persist across add-on reinstallations.

Once you're done removing the folder and files you could try redownloading the add-on and see if it works.

The most likely culprit for the initial issues I can think of are permissions changes to the folder. But since I haven't used Windows in a while I can't tell for sure. Regardless, it would be very strange if only this add-on was affected since it isn't really doing anything special other than getting a listing of all files in the folder.

reynie78 commented 6 years ago

Hey Guys, I know absolutely nothing about coding. But I found on both mac and PC that if you rename the images to ".jpg" inside the puppy reinforcement folder and then restart anki, the add on will work.

It has to be jpg, not any other file format. and it cannot be have JPEG either.

Also, if the names of the images are long/complicated/have symbols etc it might not work either. to make it work, I had to rename all the files and add .jpg at the end.

2018-04-24_11-17-47

Try it out

Z1839 commented 5 years ago

I can confirm that once I changed the file name to anything containing "IMG" it worked again. This is on the new 2.1 test build by the way.

glutanimate commented 5 years ago

@Z1839 I don't think it's IMG that's making the difference. The only thing the add-on looks for as of now is the file extension. Anything with a .jpg, .jpeg, or .png extension goes.

@usnish The original issue might have been that Puppy Reinforcement's file inclusions rules are case sensitive. So if a files ends with JPG rather than jpg it will not be recognized. I've added a note to update that in the future.

Z1839 commented 5 years ago

Much appreciated @glutanimate

I actually forgot about this issue ticket. With that said, I did notice that only the file extension matters.

glutanimate commented 4 years ago

Should be fixed with ea7772fb5ce66f320de12ef871048b2eba1e14db