Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
f23fb96a
Commit
f23fb96a
authored
15 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1231 Javadoc added
SVN: 13004
parent
2bb2bce5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/ImageUtil.java
+13
-1
13 additions, 1 deletion
...emsx/cisd/openbis/dss/generic/shared/utils/ImageUtil.java
with
13 additions
and
1 deletion
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/ImageUtil.java
+
13
−
1
View file @
f23fb96a
...
@@ -25,12 +25,18 @@ import javax.media.jai.JAI;
...
@@ -25,12 +25,18 @@ import javax.media.jai.JAI;
import
javax.media.jai.PlanarImage
;
import
javax.media.jai.PlanarImage
;
/**
/**
*
*
Utility function on images.
*
*
* @author Franz-Josef Elmer
* @author Franz-Josef Elmer
*/
*/
public
class
ImageUtil
public
class
ImageUtil
{
{
/**
* Loads an image from specified file. Supported file formats are GIF, JPG, PNG, and TIFF.
*
* @throws IllegalArgumentException if either the file does not exist or it isn't a valid image
* file.
*/
public
static
BufferedImage
loadImage
(
File
file
)
public
static
BufferedImage
loadImage
(
File
file
)
{
{
if
(
file
.
exists
()
==
false
)
if
(
file
.
exists
()
==
false
)
...
@@ -47,6 +53,12 @@ public class ImageUtil
...
@@ -47,6 +53,12 @@ public class ImageUtil
}
}
}
}
/**
* Creates a thumbnail from the specified image by preserving the aspect ratio.
*
* @param maxWidth Maximum width of the thumbnail.
* @param maxHeight Maximum height of the thumbnail.
*/
public
static
BufferedImage
createThumbnail
(
BufferedImage
image
,
int
maxWidth
,
int
maxHeight
)
public
static
BufferedImage
createThumbnail
(
BufferedImage
image
,
int
maxWidth
,
int
maxHeight
)
{
{
int
width
=
image
.
getWidth
();
int
width
=
image
.
getWidth
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment