Page 1 of 1
non square cover art?

Posted:
Sat May 07, 2011 7:55 pm
by cody_r_d
is there any way to change "coverArtSize" to give you a desired width and height?
I see in the coverArt.jsp there is a section that says
coverArtSize: Height and width of cover art.
But I cant seem to get it to work.
Any advice?

Posted:
Tue May 10, 2011 8:31 pm
by cody_r_d
I still have not figured this out.. Im wondering if I have to change the ${size} variable in the line below
<div style="width:${size}; max-width:${size}; height:${size}; max-height:${size}" title="${param.albumName}">
Any ideas?
Thanks

Posted:
Wed May 18, 2011 9:59 pm
by cody_r_d
Still no luck.. maybe if I explain what I'm trying to do. I have about 250-350 audio books and I'm using Safari and iSub on my iPad to listen to them. Its working well but the cover art is just driving me nuts. I really want it to be more like a book size and not a CD cover square. Does anyone have any suggestions on accomplishing this?
Thanks

Posted:
Sun Jun 26, 2011 8:05 pm
by cody_r_d
Im looking into this again. I am willing to paypal the first person that can get this working for me $50. Thats how much I really want to clean up my audio book section. All I want is to have a Height and Width adjustments to the cover art with in Subsonic.. Any takers?
I will paypal $50 bucks to the first person to get this working for me. I just recently found that JAVA just is not a language for me and I'll stick with Objective C.
Re: non square cover art?

Posted:
Thu Nov 17, 2011 9:49 pm
by ytechie
Well I am currently looking to have the album art adjust to the frame size to accommodate different monitor layouts. I have been able to change the overall size, but it still keeps it as a square. You have to tweak the parameter in the home.jsp file. I am looking into it right now. Hope to figure this one out!
Re: non square cover art?

Posted:
Thu Nov 17, 2011 10:23 pm
by BKKKPewsey
I may be missing the point here but in my web browser (chrome) non-square album art is displayed correctly eg non-square

Re: non square cover art?

Posted:
Sat Nov 19, 2011 7:29 pm
by fventura03
I think they mean on the home screen, would be a nice touch...

Re: non square cover art?

Posted:
Sat Nov 19, 2011 8:42 pm
by felldownawell
for me, it's the exact opposite. i get the correct dimensions on the home page and a squared image on the individual album page
Re: non square cover art?

Posted:
Wed Feb 01, 2012 10:37 pm
by cody_r_d
Has anyone been able to figure this out yet to have non-square art on the home screen? I know its a small problem but I just hate seeing all my audio books streached out like that. Thanks
Re: non square cover art?

Posted:
Sat Feb 25, 2012 12:53 am
by niz5000
I have noticed that it squashes out my 1000x1500 covers to square, yet it keeps the original aspect of my 400x572 covers. Yet when it does keep the original aspect, the image covers up the text links that are supposed to be underneath it.
Re: non square cover art?

Posted:
Mon Jul 29, 2013 5:03 pm
by bvalentin
I have checked the Java class that scales the images (CoverArtController.java). The implemented algorithm is quite weird and indeed may produce strange results. For example, the behavior is different if the image is horizontal or vertical.
In the case of the original size of 400x572, it works fine because the width is 100px multiplied by a power of 2
and the height is bigger than the width.
Anyway, here is an adapted version that should work in all cases:
- Code: Select all
public static BufferedImage scale(BufferedImage image, int width, int height) {
int w = image.getWidth();
int h = image.getHeight();
BufferedImage thumb = image;
// For optimal results, use step by step bilinear resampling - halfing the size at each step.
do {
w /= 2;
h /= 2;
if ((w < width) && (h < height)) {
// The new size fits entirely into the target size
if (1.0*w/width > 1.0*h/height) {
h =(int) (1.0 * h / w * width);
w = width;
} else {
w =(int) (1.0 * w / h * height);
h = height;
}
}
BufferedImage temp = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = temp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);
g2.dispose();
thumb = temp;
} while ((w != width)&&(h != height));
return thumb;
}
Re: non square cover art?

Posted:
Sat Aug 03, 2013 12:59 pm
by scooter1556
This code should also work and make sure that the image is the maximum size it can be whilst maintaining aspect ratio.
- Code: Select all
public static BufferedImage scale(BufferedImage image, int width, int height) {
int w = image.getWidth();
int h = image.getHeight();
float multiplier = 0;
BufferedImage thumb = image;
if (h > height)
{
multiplier = ((float)height / (float)h);
h = height;
w = (int)(w * multiplier);
}
if (w > width)
{
multiplier = ((float)width / (float)w);
w = width;
h = (int)(h * multiplier);
}
BufferedImage temp = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = temp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);
g2.dispose();
thumb = temp;
return thumb;
}
Re: non square cover art?

Posted:
Sun Aug 04, 2013 10:42 pm
by scooter1556
As a side note, before the above code will take effect on existing media the 'thumbs' directory in the Subsonic installation folder will need to be deleted to clear the image cache. On Linux that directory is '/var/subsonic/thumbs'. To complete the process, clear your browser cache and Subsonic will begin creating thumbnails from scratch with the new code.
Re: non square cover art?

Posted:
Wed Oct 30, 2013 7:47 pm
by cody_r_d
I just wanted to say thanks to bvalentin and scooter1556. for some reason I never got the email notification that someone posted to this thread. I will test this out tonight and get back if all works.
Thanks again.
Re: non square cover art?

Posted:
Wed May 07, 2014 4:31 pm
by felldownawell
scooter1556 wrote:This code should also work and make sure that the image is the maximum size it can be whilst maintaining aspect ratio.
- Code: Select all
public static BufferedImage scale(BufferedImage image, int width, int height) {
int w = image.getWidth();
int h = image.getHeight();
float multiplier = 0;
BufferedImage thumb = image;
if (h > height)
{
multiplier = ((float)height / (float)h);
h = height;
w = (int)(w * multiplier);
}
if (w > width)
{
multiplier = ((float)width / (float)w);
w = width;
h = (int)(h * multiplier);
}
BufferedImage temp = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = temp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);
g2.dispose();
thumb = temp;
return thumb;
}
Thanks so much for the code bvalentin and scooter1556.
Can anyone assist with guidance on implementation of this on a Windows box. I've pulled coverartcontroller.class into an editor, adjusted the code in the corresponding .java, saved it, and killed the thumbs folder. I'm sure I'm just being dense, but I have not worked with editing java class files before.
Thanks.