You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by bu...@apache.org on 2009/01/04 12:25:19 UTC
DO NOT REPLY [Bug 46468] New: PNG's - warn if resolution can't be
determined
https://issues.apache.org/bugzilla/show_bug.cgi?id=46468
Summary: PNG's - warn if resolution can't be determined
Product: XMLGraphicsCommons
Version: Trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P2
Component: Image codecs
AssignedTo: general@xmlgraphics.apache.org
ReportedBy: jason@plutext.org
If, for a PNG image, ImageMagick's identify says:
Resolution: 320x320
Units: Undefined <----------------
then ImageInfo will use a default value, using
Toolkit.getDefaultToolkit().getScreenResolution(), which in my case is 160.
Nothing wrong with that I suppose, but it would be helpful if a warning was
logged or something, so you knew to fix the image.
When PreloaderImageIO.preloadImage does:
ImageIOUtil.extractResolution(iiometa, size);
it is finding the Dimension child, but not "HorizontalPixelSize" or
VerticalPixelSize (these are null).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org
DO NOT REPLY [Bug 46468] PNG's - warn if resolution can't be
determined
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46468
Glenn Adams <ga...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P3
Status|NEW |NEEDINFO
Platform|PC |All
OS/Version|Linux |All
--- Comment #3 from Glenn Adams <ga...@apache.org> 2012-04-10 21:58:27 UTC ---
jason, if you would like to submit a patch following Jeremias' recommendation
in comment 2, then i'd be happy to apply it; otherwise, i will mark this as
resolved+later due to lack of action
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org
DO NOT REPLY [Bug 46468] PNG's - warn if resolution can't be
determined
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46468
--- Comment #1 from Max Berger <ma...@berger.name> 2009-01-21 01:04:27 PST ---
I haven't taken this bug yet as I am still unsure about the proper solution.
Currently:
getDefaultResulution is called, result stored.
Resultion of image is determined if possible, and overwrites default
resolution.
The problem:
this happens in multiple different places (PNG is just one). A proper solution
would handle all of them.
We could add the warning to each case, but that would not make much sense.
Instead, a common function should warn, which means:
in each case:
resolution = null;
determine resolution from image;
fallbackIfneeded(resolution)
and fallbackifneeded would do:
if resolution == null
emit warning
resolution = defaultResolution.
The problem here: Other calculations, such as the image size, depend on the
resultion being set beforehand. Each of the cases would need to be examined if
the resultion could be safely set AFTER the other image info is parsed.
Second issue: Not all image formats support resultion.
minor issue: Some images support different x,y resolutions, this should also be
taken into account.
Max
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org
DO NOT REPLY [Bug 46468] PNG's - warn if resolution can't be
determined
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46468
Jason Harrop <ja...@plutext.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason@plutext.org
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org
DO NOT REPLY [Bug 46468] PNG's - warn if resolution can't be
determined
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46468
--- Comment #2 from Jeremias Maerki <je...@apache.org> 2009-02-09 13:38:14 PST ---
Sorry for being late here (being the original author of the thing). The issue
here shows that someone was able to make use of the image loading framework
outside the FOP context which makes me happy. Mission accomplished. ;-) As for
the missing resolution information:
If using Toolkit.getDefaultToolkit().getScreenResolution() for the fallback
resolution is a problem, you can always use your own implementation of the
ImageContext interfaces. I'm also doing that in FOP where the default source
resolution if configured in an XML file.
If it is important to be notified if an image resolution is missing, I think
the most straight-forward solution is to introduce a listener interface which
can be made available through the ImageContext. Something like the following
maybe:
public interface ImageLoaderListener {
void notifyMissingImageResolution(Object source, String uri, String mime);
}
I can imagine that, in time, we may add additional features either to the
listener or the Image(Session)Context.
Max noted different resolutions for X and Y. Some formats support that.
Personally, I've never seen an image with different X and Y resolutions, yet.
So if there's no need I wouldn't complicate things prematurely. That can always
be easily added in a backwards-compatible way if it's really needed. At any
rate, ImageInfo supports separate resolutions, just in case. But I don't
believe it's needed for the fallback.
WDYT?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org