Files
libreoffice/reportbuilder/java/com/sun/star/report/ImageService.java
Stephan Bergmann 86a60b3655 fdo#38791: Do not use java.awt, causes problems on Mac OS X
On Mac OS X, it apparently suffices to execute "new java.awt.Dimension()" to run
into "Apple AWT Java VM was loaded on first thread -- can't start AWT" (see
<http://developer.apple.com/library/mac/#technotes/tn2005/tn2147.html> "JNI
Development on Mac OS X - Thread-Safe JNI Programming - Calling AWT/Swing From
AppKit").

The solution here is simple, in that uses of java.awt.Dimension can be replaced
with com.sun.star.awt.Size without loss of functionality.  However, there are
still occurrences of java.awt.Image and java.awt.Toolkit lurking
(reportbuilder/java/com/sun/star/report/SOImageService.java,
reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java,
reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java)
for which it might be sheer luck that they do not seem to cause trouble yet.

Change-Id: I33e9f74c50ebddc11bd1d9a48c55dc8f8700345d
2012-08-23 14:34:56 +02:00

62 lines
1.8 KiB
Java

/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package com.sun.star.report;
import com.sun.star.awt.Size;
import java.io.InputStream;
/**
*
* @author oj93728
*/
public interface ImageService
{
/**
* @param image
* @return the mime-type of the image as string.
* @throws ReportExecutionException
*/
String getMimeType(final InputStream image) throws ReportExecutionException;
/**
* @param image
* @return the mime-type of the image as string.
* @throws ReportExecutionException
*/
String getMimeType(final byte[] image) throws ReportExecutionException;
/**
* @param image
* @returns the dimension in 100th mm.
*
* @throws ReportExecutionException
* @return*/
Size getImageSize(final InputStream image) throws ReportExecutionException;
/**
* @param image
* @returns the dimension in 100th mm.
*
* @throws ReportExecutionException
* @return*/
Size getImageSize(final byte[] image) throws ReportExecutionException;
}