Read image from file
Dear all,
I would like to know how to read a gif or jpeg image from file to a binary stream?
So that I can transfer through the internet using a http POST request.
Thank you very much.
Use FileImageInputStream.. See api docs for further reference
Cheers
-P
Similar Messages
-
Report 6i - Read Image from file - REP-0606
Hi,
With report 6i on a PC, I load JPG images, with path and name defined in a column, from a NT server into the report. Everything is OK but sometimes the image format seems to be incorrect and I get a "REP-0606 : Unable to read link file ....". I haven't any access to those images so I have to trap the error directly in my report.
But How ?
ThanksHi Thierry,
I have to trap the error directly in my reportI guess you mean that you want to catch this message and show your own error message.
Well, I don't think this is possible.
By the way, I did some research into the error that you are hitting. It is a known issue, and the reason is that there are many JPEG file types, like progressive JPEG, low-quality, high-quality, etc etc. Reports 6i does not support some of these types, and thats why you are hitting this error. Just for your information, we have eliminated this restriction in Reports 10g (9.0.4), so you might want to try your report in 9.0.4 and if satisfied, think about migrating to 9.0.4.
Navneet. -
Hi,
I am having a very difficult time being able to read images from a JAR file via my Applet. I have tried everything that I know about with no luck. The only way I can get this to work is to store the images individually in a sub directory of public_html on the websever. This works, but I would like the images to come down in a JAR file for performance reasons.
I am using Internet Explorer 5.5 for my browser. I checked the options and everything seems to be in order, but......
I would appreciate any feedback that anyone might have on this topic..........
Thank You....once in a jar file i inserted a image
the jar file on clicking starts an frame.
so the image was for getting that image at the icon place at top and at minimized window
i could not get that image from jar file by new imageicon().getimage();
but i get the image if it is in the directory in which jar file is.....
can one explain the reason -
How to read some images from file system with webdynpro for abap?
Hi,experts,
I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
How to read some images from file system with webdynpro for abap?
Thanks a lot!Hello Tao,
The parameter
icm/HTTP/file_access_<xx>
may help you to access the pictures without any db-access.
The following two links may help you to understand the other possibilities as well.
The threads are covering BSP, but it should be useful for WebDynpro as well.
/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
Best regards
Christian -
Read images from external jar file (Sun's Java L&F Graphics repository)
Hi!
I don't know how to read images from an external jar file. Sun has a Java Look and Feel graphics repository that contains a lot of good images that can be used on buttons and so on. This repository is delivered as a jar file, containing only images, and I want to read the image files from that jar file directly without including them inside my application jar file. The application and image jar files will be in the same directory.
I have absolutely no clue how to solve this. Is it necessary to include the images inside my application jar file or is it possible to have them separate as I want.
Would really appreciate some help!
Best regards
LarsHi,
There is two ways :
1) Add your jarfile to the classpath.
Use the class loader :
URL url = ClassLoader.getSystemResource("your/package/image.gif");
Image im = (new ImageIcon(url)).getImage();
or
Image im = Toolkit.getDefaultToolkit().getImage(url);2)If you don't want to add the jar to the classpath you can use this (under jdk 1.4):
import java.util.*;
import java.util.jar.*;
import java.awt.*;
import java.io.*;
import java.awt.image.*;
import javax.imageio.*;
public class ImageUtilities {
public static Image getImage(String jarFileName, String fileName) {
BufferedImage image = null;
try {
JarFile jar = new JarFile(new File(jarFileName), false, JarFile.OPEN_READ);
JarEntry entry = jar.getJarEntry(fileName);
BufferedInputStream stream = new BufferedInputStream(jar.getInputStream(entry));
image = ImageIO.read(stream) ;
catch (Exception ex) {
System.out.println(ex);
return(image);
}I hope this helps,
Denis -
Bug: "Read metadata from file"
When I add GPS coordinates to a file (with the program Geotagger) and select "read metadata from file" to import the new metadata, a color adjustment badge appears on the thumbnail (even though I didn't adjust any colors). This only happens with files that have a cropping applied to them in Lightroom. If the file doesn't have a custom cropping the color adjustment badge doesn't appear. It happens with both JPG and CR2 files. Seams like a bug to me.
I'm on a 24" iMac 2.8 with 4 GB and OSX 10.5.5 / Lightroom 2.1It also happens with DNG. Anyway, I don't think it has anything to do with the GPS, but the issue has been around right back through version 1.x Try the following:
1. Select an image that has no crops or develop adjustments
2. Switch to Develop module
3. Apply a crop
4. Save metadata to file (Cmd+S)
5. Read metadata back from file (Metadata menu - "Read Metadata from file"
Please report what happens?
At my end the Crop badge remains but a Develop Adjustment badge also appears - IMO it shouldn't, but as stated above it has for a VERY long time. I'll bug it again and see what happens. -
Hi Everybody,
I wonder if Lightroom 3 offers a function that lets me read metadata from file for multiple images in a batch process. The reason is that I have changed the GPS information for quite a couple of my pics using the Geoencoding Support pluging from Jeffrey Friedl and let it write back into the DNG-file. Since I also flushed the shadow data I can't see any GPS information in my metadata table in Lightrrom even though the data are present in the DNG. Now the real question is: Is there a better way to get my GPS data into Lightroom than emptying the Library and reimport all of my pics?
Oh, and before I forget it: Yes, I have searched this forum - and a couple of others as well - and I found stuff about batch processing date/time information. However, the method presented there apparently does not apply to my problem.
Thanks for any information.
Have a nice day,
f.In Library Module, select Grid Mode. Select all images you wish to read metadata from. Go to Metadata>Read Metadata from Files
Similarly, you can edit time for time zone/ AM-PM issues, etc by going to Metadata>Edit Capture Time -
We use proxies in our work flow, pre-rendering certain comps before rendering out the final project. For the most part this works fine, but occasionally we'll get an error that reads: "Error (4) reading frame from file." It's always the same comp but it doesn't cause the problem in every project.
We use the quicktime codec with Tiff compression. Could it be a memory issue? Any help would be greatly appreciated. The error always pops up at the most inconvenient time -- of course.
Thanks,
JulianWell, if it's always the same file, then most likely one of the source footages is really damaged. The error not occuring every time mustn't mean anything. If the element in question is not visible at the given frame or AE doesn't do anything with it because it isn't required, naturally the error would not occur. I'm afraid the only way to track this down is to selectively disable/ remove the sources from the comps in question and render some test clips. Perhaps it would also help to check all the files used in the project in a "neutral" app such as external image and video viewers (XnView, VLC, MediaPlayer Classic...)
Mylenium -
Can load image from file using LabVIEW and display on IMAQ graph?
I dont have IMAQ Vision for LabVIEW on my computer. Is it possible to load image file and display on an IMAQ graph?
Thanks!Hey werwr,
In response to: "I dont have IMAQ Vision for LabVIEW on my computer. Is it possible to load image file and display on an IMAQ graph?"
As of right now, in order to read an image from file, you actually do need the IMAQ Vision software. The IMAQ driver without the Vision VI's will allow you to collect images from a framegrabber, and it will allow you to save those images to file. But the function that allows you to read an image from file does require the Vision VI's. Once you have the VI to read images from a file, you will be able to display the image on an IMAQ "Graph" or otherwise known as an Image Display.
I hope this helps. Please let me know if you have any further questions.
Thanks,
DJ
Applications Engineer
National Instruments -
i want to interact with hardware(scanner) in java
i want to read image and store in database
for this
1.) i want to read image from scanner
2.) how do i start scanner process
from where i gonna start
plz help me to interact with hardwareHi, I have faced a similar problem and solved it using the morena api http://www.gnome.eu/Twain/examples/studio.html
Problem is the scanner works fine with TWAIN, but with SANE, it is totally failing. There is a permanent connection refusal form the scanner ip whenever
i try to use a network scanner. I am not sure how to solve it. If anyone has solved this please revert back.
Regards,
Anthony -
Read image from excelsheet using labview
i need to know how to read image from excel sheet using Labview...m not able to get the appropriate property to display the image stored in excel sheet.
thank youyou need to ask Microsoft to find out the property name/location under Microsoft Excel.
-
Bug: Keywords behave incorrectly after "Read Metadata from File"
(Happens in LR3.4 RC and probably also in previous versions... but I am not sure if it happened in LR2)
The problem seems tro be somthing like de-sync of database status and what we see on the screen.
1) Let's say we have a photo with keyword "abc"
2) Click in the Keyword List on the arrow around the "abc" keyword to show only photos with this keyword (single one), leave the filter on this settings
2) Save Metadata to File
3) Edit XMP in an external application, add new keyword "def"
4) Read Metadate from File
5) Now what happens is: The photos disappers from the screen as if it lost the "abc" keyword (weird), but if you look at the Keyword List, the "abc" keyword has still 1 photo attached to it. Also, if you release the filter and find the photo, it clearly has the "abc" and "def" keywords in the Keywording panel. And you can search for this keyword in the text filter (works correctly), but if you click on the arrow around the "abc" keyword, the photo is not shown.
6) If you restart the Lightroom, it will work correctly again.
I have an own application that is able to modify the XMP and the modifications may not be perfect, but in my opinion, this shouldn't happen when reading the metadata. If any developer is reading this, I can supply a file with original and changed metadata for debugging.
It would be great it this could be resolved.
Thanks!Please do report your find with the details you state (well done!) here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Thanks......... -
Export with Table Splitting : ORA-01115: IO error reading block from file
Hello,
We are in perfroming the last dryrun of our CU&UC conversion.
The are now in the process of exporting the ECC6 system (Oracle 10.2.0.4.0, HPUX ia64) using sapinst features, "table splitting preparation"
When doing so, we are facing critical errors :
Creating file /export_uni/sapinst_splitting/ora_query3_tmp3_1.sql.
ERROR 2010-08-11 10:27:28.881
CJS-00084 SQL statement or script failed. DIAGNOSIS: Error message: ORA-12801: error signaled in parallel query server P002
ORA-01115: IO error reading block from file 90 (block # 16640)
ORA-27072: File I/O error
HPUX-ia64 Error: 22: Invalid argument
Additional information: 4
Additional information: 16640
Additional information: -1
ORA-01115: IO error reading block from file 90 (block # 16640)
ORA-27072: File I/O error
HPUX-ia64 Error: 22: Invalid argument
ORA-06512: at "SAPR3.TABLE_SPLITTER", line 775
ORA-06512: at line 1
I have therefore perfmed a dbverify ; no corruption has been recorded.
When trying to perfrom the EXPORT, without table splitting ; it works fine ...but the processing time is extremely long, as you can imagine. Any help would be highly appreciated.Regards.
RaoulThank you Stefan,
Our HPUX Release seems to be indeed 11v3,
[root@:/root]# uname -a
HP-UX B.11.31 U ia64 2566039091 unlimited-user license
I'll check the installation of the patch and keep you informed
Thank you
Raoul
Edited by: Raoul Shiro on Aug 11, 2010 11:57 AM -
I would like to read data from files in EJBS (Stateless Session Bean I think). I've heard that the EJB sepcifications don't allow to use the java.io package to access the filesystem. How can I resolve this problem? Possible solutions I've thought of are:
* Use a webserver to store the data
* put the files in a jar and access them using the getResource() in the classloader class
Could you comment on this plesae
greetingsThe specification states:
"An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data."
From this I understand I cannot acces files directly, but it does not specifiy I can't use the java.io package at all. It specifically says not to use the java.io package to acces files and directories, they don't say anything about using the classes for other use.
however, a litle lower the specification states:
"The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams.
These functions are reserved for the EJB Container. Allowing the enterprise bean to use these functions could compromise security and decrease the Container�s ability to properly manage the runtime environment."
I'm not sure how to interpret this, but I believe this rule makes my solution invalid.
Please comment on this,
thanks -
Hi, I've been looking at some resources online but cant seem to understand it very well.
I have been given partially completed code from my lecturer, and i have to complete this code.
I'm not looking for solutions but if you would be so kind to either explain or point me into the direction of helpfull resources i would be very gratefull!
Heres my partially completed code:
public void load(File file){
String line;
String[] fields;
try {
BufferedReader in = new BufferedReader(new FileReader(file));
line = in.readLine();
this.setName(line);
line = in.readLine();
fields = line.split(",");
HeadOfSchool h = new HeadOfSchool(fields[0], fields[1], fields[2],
Integer.parseInt(fields[3]), Integer.parseInt(fields[4]));
// COMPLETE THE READING IN FROM FILE
// ADD YOUR CODE HERE
in.close();
} catch (IOException e) {
// ADD YOUR OWN CODE HERE
}Here is the contents of the file which is being read in:
The file which stores information about the school is as shown below
School of Computing
Prof Shirley Campbell,Aberdeen,female,45,45000
8
Dr John Smith,Aberdeen,male,40,28000
Dr Joan Simpson,Aberdeen,female,30,27500
Mr Tony Orlando,Banchory,male,40,27500
Dr Craig Stuart,Aberdeen,male,38,18500
Dr Moira Cables,Aberdeen,female,35,22500
Dr William Green,Aberdeen,male,38,35500
Mr Henry Brown,Aberdeen,male,37,27265
Ms Jill Blossom,Aberdeen,female,48,30000
Course UG1,4
Alan Smith,Aberdeen,male,35,A
Mary Grant,Banchory,female,25,B
Joe Bloggs,Aberdeen,male,42,A
Jack Hawkins,Stonehaven,male,30,C
Course UG2,5
Susan Clark,Aberdeen,female,18,C
Carol Roberts,Murcar,female,32,B
Roy Rogers,Ellon,male,37,B
Melanie Sykes,Murcar,female,22,A
Colin Firth,Aberdeen,male,27,A
Course UG3,3
Cindy Lauper,Aberdeen,female,27,A
Jim Bowen,Banchory,male,47,C
Andy Townsend,Arbroath,male,35,BFormat of the file:
The format if the file is
Name of school
Details of the Head of School
Number of Lecturers
List of Lecturers
Name of course1, number of students
List of Students
Name of course2, number of students
List of Students
Name of course2, number of students
List of Students
Name of course3, number of students
List of StudentsSorry if i havent supplied you with relevant details, just let me know if theres anything else i need to let you guys know
ThanksThe code given to you as an example demonstrates how to open the file, read a line of data from it, and split that line into parts.
You are given the format of the file, and example data.
So - given that you know how to read a line of data from the file and split it into parts, and given that you know what the lines of the file look like - can you write out in your native language what you need to do, using "read a line", "split the line into pieces", "use the nth piece" operators, to process the file? If you can, then do, and convert that to Java. If you can't, then you need to back up and understand your problem better, then try to write out your solution in your native language.
If you run into any specific, technical problems come back and ask away
Good Luck
Lee
Maybe you are looking for
-
How to read a number from a web page
hello everyone I need to read a number from a webpage. This number is online electricity price which is updated every 5 min. I need to use this price as a parameter in my controller any suggestion will be appreciated in advance Reza Solved! Go to Sol
-
10.6.8 with adobe CS3
In a situation where I need to maintain Adobe CS3 MS on a MacPro to convert older Quark files to InDesign via Markzware. Converting in CS5 makes it unavailable to designers in Europe in SoAmerican who still maintain CS3 and CS4. It's a tricky situati
-
Update sql statement in sender/receiver jdbc adapter
Hi What is the update sql statement we give in the sender/ receiver adapter when 1) SELECT statement was written in query sql statement 2) EXECUTE statement was written for a stored procedure in query sql statement thanks Anitha
-
Contacts not being sorted by last name
Hello, We recently received 2 Windows HTC 8x Phones (one for me and one for my son) and I wanted to sort my contacts (people on this phone) by last name. However it is not working correctly, it seems some contacts get sorted while others do not and t
-
The presentation link on Oracle Integration Adapters home is broken (404). Please fix it, thanks. http://www.oracle.com/technology/products/integration/adapters/pdf/PS_AdaptersProductPresentation.pdf