Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Avatar alpha channel [DONE]

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the forum makes avatars png files. Well that's nice unless we have an alpha channel in source image. First, as I remember, you're using INT_RGB image model, which effectively means that alpha channel is lost. Second, some broken browsers (like MSIE) don't use alpha channel in PNG's anyway (or they use it wrongly), so if you'd use INT_ARGB, then well, I guess it won't help much.

The question is: why do you convert them to png? Just check the size and leave them alone

(The bug with background is visible when using GIF's as avatars. Look at admin's avatar at http://dan.solutions.lv/forum - it should have transparent, not black, background.)

JIRA Entry: http://www.jforum.net/jira/browse/JF-2
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep, am just using RGB.. that was a tricky and quickly fix. Wanna do a better version? ;)

On png files convertion, as GIF is patented, many libs doesn't have default suport to it, when I convert all gif to png. This was simpler than checking the size. Well, I should check the size and, if the image was tiny, let it go. If was bigger, then I get that gif and resize to the correct size, saving as png.

The alpha channel should be fixed, anyway. As you can see at ImageUtils.java ( net.jforum.util.image ), I have some set of methods to work with images.. not big stuff, anyway.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ImageUtils.java wrote:
Graphics g = bi.createGraphics();^M
g.drawImage(image, 0, 0, w, h, null);^M


This won't look very nice, anyway (since you don't do any antialiasing). I think better way is just to copy uploaded image file.

[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Daniil wrote:

ImageUtils.java wrote:
Graphics g = bi.createGraphics();^M
g.drawImage(image, 0, 0, w, h, null);^M


This won't look very nice, anyway (since you don't do any antialiasing). I think better way is just to copy uploaded image file.



Well, my knowledge of image processing is 1%.. this 1% I got doing this class ;)

Wanna CVS access?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I don't know how to use CVS. And I'm not feeling familiar enough with your code

If you teach me how to make patches, hovever, ops: this will be nice.
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
www.eclipse.org ;)

Well, do you use Linux? you can use the "diff" program ( and no, I no longer use linux hehe ).

You can send changed code you made, that's nice.. just put some information like "SomeFile.java, like 312" etc..

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I'll grok diff/patch

Meanwhile, you can try diff'ing that charsets stuff yourself after downloading tar.bz's I've pointed you in the charsets topic to.

And I have another bug report for you, just watch me opening new topic ;]
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok.. I'll do that

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Daniil wrote:OK, I'll grok diff/patch

Meanwhile, you can try diff'ing that charsets stuff yourself after downloading tar.bz's I've pointed you in the charsets topic to.

And I have another bug report for you, just watch me opening new topic ;]



hhmm.. where I find the file? :roll:

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafael Steil wrote:

Daniil wrote:OK, I'll grok diff/patch

Meanwhile, you can try diff'ing that charsets stuff yourself after downloading tar.bz's I've pointed you in the charsets topic to.

And I have another bug report for you, just watch me opening new topic ;]



hhmm.. where I find the file? :roll:

Rafael


See this thread: https://coderanch.com/t/574446

[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bug here

If the extension was "jpeg" file will be written as png (Example: my avatar at this forum ).

Anyway, if image does not exceed max allowed dimensions, I think forum should write the avatar file as-is. Maybe I'll think about this again tomorrow, hehe
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, am "closing" this topic.. I changed the code to check for the image type and look for some alpha channel.. Better image support will be considered as "Feature" ;)

Rafael
[originally posted on jforum.net by Rafael Steil]
 
reply
    Bookmark Topic Watch Topic
  • New Topic