searene / Anki-Addons

This repository is used to store all kinds of anki addons that I created
MIT License
24 stars 3 forks source link

Does not work on Ubuntu 15.10 and Anki 2.0.32 #2

Open scarline opened 8 years ago

scarline commented 8 years ago

Hi, I changed a couple of months to a 4K screen. So actually all my pictures are far too small. This plugin could work very good on this problem.. The plugin was installed and its menu is shown. But the images are not resized automaticly or by the shortcut. What can I try to fix this? (In addition the toolbar-button is cropped)

Thanks!

searene commented 8 years ago

Hi, scarline

I'm using ubuntu 15.10 and anki 2.0.33, so it should work. I'm not sure why it didn't on your computer. This addon only works when you are pasting images while adding new cards, it cannot change the size of the images which are already in your previous cards before.

By the way, recently I found that there was a workaround which could achieve almost the same effect as the addon. Click on Card... when adding new cards, go to the Styling part, add the following code:

img {
    height: 500px;
}

image size

Then close the window. When you're reviewing new cards, anki will automatically change the images' height to the value you specified above(500px in this case), if you want to change the width, change height to width, just as follows:

img {
    width: 500px;
}

Hope it helps.

scarline commented 8 years ago

Hi searene,

thanks for your reply. The declaration in the css helps of course. Ob A 4k screen my pictures have to be at least 1280px in width to see enough detail. Otherwise they are to small. The problem is, that the css is scaling just to the image max in size. For example: When I got a picture that is sized 4800 px in width and my css says

.backsinde img{
  width: 1920px;
  height: auto;
 font-family: Ubuntu Condensed;
 font-size: 25px;
 font-weight: 500;
 margin-top: 25pt;
 margin-bottom: -10pt;
 text-align: left;
 color: black;
 background-color: white;
}

then the picture is scaled down normally. But when the same image is 850px in width it is not scaled up to 1920px. Can I supply additional info for you to get the problem of the addon fixed? By the way: Are you using jpgs? I just got pngs.

scarline commented 8 years ago

In addition: svgs are not rescaled at all by anki. Just the default size is shown. It would be perfect when scaling would work in up and down direction.

searene commented 8 years ago

Hi, scarline,

I just updated the addon. You can download the addon again, I added reset and log this time.

I'm not sure why it doesn't work in your case, because we are using almost the same OS and anki version. Since I add log this time, These are the steps to help me find the reason.

  1. Update ImageResizer in anki.
  2. Copy an image and paste it when adding new cards
  3. Click on Tools --> Add-ons --> Open Add-ons Folder... in Anki menu, and look for a folder called ImageResizer, then you will find a file called imageResizer.log in it, paste the contents of the file in here, so I could see what went wrong.

By the way, I also noticed that the add-on didn't work when you tried to copy an image file and paste it in anki. I'm working on the problem. Here's a quick fix: open the file with any image-reader (usually I use Eye of gnome, the default image reader on ubuntu), right-click the image, copy and paste in anki. In other words, there's an extra step you have to go through: open the image file

It also works if you copy an image in your web browser, if it helps.

By the way, what do you mean by "work in up and down direction"?

searene commented 8 years ago

svg files work now, and you can copy and paste without open image files. You may want to update the addon and try again.

scarline commented 8 years ago

Hi searene,

currently I am super-busy. I will try this next weekend or coming Monday, I meant, that rescaling should work in both directions. Up and down. Currently my experience is, that just downscaling is working.