Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-18-2019, 10:25 PM   #1
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
added custom column icons render larger than original icons

I'm trying to use column icon rules to map some custom column text to icons: the columns already contains 'Yes' and 'No' and those are displayed as checkmark and cross, respectively, as they should. I'm using copies of those same two icons to create my new icons, and everything works, except that the new icons (which are being placed in the cc_icons directory by calibre, as expected) are being displayed at a slightly larger scale than the original ones. At a glance I'd say they're about 50% bigger than the originals. I have noticed that when I use an exact duplicate of an existing icon to "add icon", the new PNG file that's created in cc_icons is about 25% larger than the original PNG file, but is still 128 pixels square. Any idea what's going on? How can I force my new ("add icon") icons to render at the same scale as they do when they're automatic "show checkmarks" icons?

Thanks!
masp is offline   Reply With Quote
Old 01-18-2019, 10:27 PM   #2
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
Attached screenshot showing new, larger custom icon, below two instances of original icon (from which it was copied).
masp is offline   Reply With Quote
Advert
Old 01-18-2019, 10:29 PM   #3
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
trying again to add screenshot...
Attached Images
 
masp is offline   Reply With Quote
Old 01-19-2019, 09:55 AM   #4
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
I made my "Entity Manager" plug-in icons smaller than otherwise shown in the Library View by using Irfanview to create one that looks smaller, although it is still 128x128. Simply open an original copy in Irfanview, and then:

[1] Resize to 128x128 if it is not already
[2] Click Image > Add Border/Frame
[3] Select Plain White Frame
[4] Change the top border width to 50 pixels (the others 0) and Add the Frame
[5] Repeat #4 to make it even smaller in the end
[6] Resize the entire image back to 128x128 (it grew with the Frame) collapsing the original towards the middle.
[7] Click Edit > Show Paint Dialog
[8] Select White with the bucket of paint tool
[9] Fill in all areas around the original icon with White
[10] Save as a .png, clicking on the White as the .png "Transparent" color

The 128x128 icon now has more White around the original icon, making it look smaller in the Library View because of the transparent color around it.


DaltonST

Last edited by DaltonST; 01-19-2019 at 09:57 AM.
DaltonST is offline   Reply With Quote
Old 01-19-2019, 04:16 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,457
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@masp - it would seem that different icon display sizing algorithms are used for the Yes/No (and checkmarking) icons and column icons. Maybe because a column icon can be displayed along side its text, or within a composed set (array) of icons, or maybe because it just is

You could do as DaltonST suggests and edit the green tick and red cross icons to have a transparent frame before you add them to cc-icons, or you could find some alternative icons. I'd do the latter so as to clearly distinguish my column icons from calibre's Yes/No icons.

BR
BetterRed is offline   Reply With Quote
Advert
Old 01-19-2019, 08:54 PM   #6
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
@DaltonST thanks for the detailed workaround: I will try to find a suitable mac osx application (maybe the Gimp?) to do it.

@BetterRed yes that's what I figured: I was trying to be a bit lazy since my column is already a yes/no column, but with added likely/maybe/unlikely values in the middle, so I was hoping to be able to continue using automatic checkmarks for yes and no, and then add custom (icon) rules for likely/maybe/unlikely: that clearly works, just looks awkward due to the different scaling algorithms. I'll use the icon resizing trick to try to match the scales for now (assuming I can't just get over the aesthetic jarring sensation and continue with the mis-matched scales!)

Thanks!
masp is offline   Reply With Quote
Old 01-19-2019, 11:34 PM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,457
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@masp - even if the resizing was consistent, I'd still avoid using the icons used by Yes/No columns.

I'd use a program mode template that sets the icon for each of the possible values (true, likely, maybe, unlikely and false) in a single column icon rule. Having the icon controlled by a column definition setting AND column icon rule settings would confuse me no end.

I can't remember exactly why, but I consciously avoid using calibre's built in icons for column icons, I suspect it might be something to do with the built in icons changing in version 2, or was it 3.

BR

Last edited by BetterRed; 01-19-2019 at 11:40 PM.
BetterRed is offline   Reply With Quote
Old 01-19-2019, 11:56 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC the display path for yes/no icons and custom icons is totally different, one is rendered by Qt and is dependent on the Qt style/theme, the other by calibre, so you are unlikely to get consistent results.
kovidgoyal is offline   Reply With Quote
Old 01-21-2019, 02:07 PM   #9
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
@BetterRed thanks that's a good point! This is my current template:

{tags:'in_list($, ",", "keep", "Yes", "^probably keep ?.*", "Likely", "^possibly keep ?.*", "Maybe", "^probably discard ?.*", "Unlikely", "^discard ?.*", "No", "")'}

Can you possibly give me an example of how to modify that to generate an icon rather than text? Many thanks in advance!

@kovidgoyal Thanks that makes sense: I'll try to stop obsessing over the typography
masp is offline   Reply With Quote
Old 01-21-2019, 02:09 PM   #10
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
Actually what I'd really like is to be able to define a new (5+1 state) "Yes/No" column *type* (Yes/Likely/Maybe/Unlikely/No + empty), and then be able to use assign that new column type to any custom column: I can't see any way to do that, but is it conceivably possible?
masp is offline   Reply With Quote
Old 01-21-2019, 03:59 PM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,457
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by masp View Post
Actually what I'd really like is to be able to define a new (5+1 state) "Yes/No" column *type* (Yes/Likely/Maybe/Unlikely/No + empty), and then be able to use assign that new column type to any custom column: I can't see any way to do that, but is it conceivably possible?
AFAIK users can't define new column types.

The nearest you will to get to what what you want, is to define multiple columns with column type "Text, with a fixed set of permitted values", with the same set of values. There is no copy column definition feature.

It maybe possible to devise a reusable Template Function (python) to set the icons for the similarly defined custom columns. Or use Export (json), a bit of cut/paste/edit in a editor, and Import.

BR
BetterRed is offline   Reply With Quote
Old 01-22-2019, 03:33 PM   #12
masp
Enthusiast
masp began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Sep 2014
Device: ipad air
@BetterRed thanks: one remaining point of confusion for me: when you said "I'd use a program mode template that sets the icon for each of the possible values (true, likely, maybe, unlikely and false) in a single column icon rule", I can't figure out how to make my custom column template output icons...
masp is offline   Reply With Quote
Old 01-22-2019, 04:07 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,457
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@masp - something like this (not tested)

Code:
program:
 first_non_empty
 ( 
		contains(field('#keep'), "Yes", 'MyYes.png', ''), 
		contains(field('#keep'), "Likely", 'MyLikely.png', ''), 
		contains(field('#keep'), "Maybe", 'MyMaybe.png', ''), 
		contains(field('#keep'), "Unlikely", 'MyUnlikely.png', ''), 
		contains(field('#keep'), "No", 'MyNo.png', '')
 )
You may not need the first_non_empty, and you might want to start with if_empty(field(#keep), "Transparent.png")

Tip - keep this handy ==>> Reference for all built-in template language functions - on paper, device, 2nd monitor

BR
BetterRed is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a icons only custom column? pleiadesc Library Management 3 09-24-2017 08:58 PM
customized column icons now Micro-icons Gary_M_Mugford Calibre 10 09-05-2016 04:05 AM
Custom Column Icons? tarisea Library Management 90 01-17-2014 06:12 PM
Multiple icons in a column? RenoA Library Management 2 09-09-2013 03:20 AM
Classic Original nook icons for mynook.ru Launcher? Kypt Barnes & Noble NOOK 5 09-17-2010 11:32 AM


All times are GMT -4. The time now is 07:34 AM.


MobileRead.com is a privately owned, operated and funded community.