Comments
Posted by r r ludwig on 09/20/2005 05:22:54 AMResized pictures in a view
Hello George
I like your image resize tool
but i cannot get the pictures in a view (because they are in a rtf field)
Is there an option to write the resized images as attachments or in a textfield (that contains the image)
Thanks in advance
Richard
Posted by George MacDonald on 09/20/2005 06:09:32 AMViewing images in a view
Thanks Richard:
if you want to see the pictures in a view use the following syntax :
<img src=\"/"+@WebDbName + "/0/" + @Text(@DocumentUniqueID) + /photoThumb/M1?OpenElement\">
as the column definition. I usually have the rows of a table in the view and then wrap the entire embedded view ( views as HTML) with <table></table> tags so the whole row is something like:
"<tr><td><img src=\"/"+@WebDbName + "/0/" + @Text(@DocumentUniqueID) + "/photoThumb/M1!OpenElement\"></td><td width=\"100%\"><a href=\"" + "/" + @WebDbName + "/0/" + @Text(@DocumentUniqueID) +"\">" + field1 + "</a></td><td>" + field2 + "</td></tr>"
Obviously changing it for what you've called your image and data fields.
HTH, George :)
Posted by r r ludwig on 09/21/2005 02:40:36 AMJava is not dead
Great,
problem solved
can i also run it in the webquerysave ? with save options=0 ? (i do not want the original file in the document)
thanks
Posted by George MacDonald on 09/21/2005 03:01:20 AMDeleting the attachment
Hmm, not tried it in WebQuerySave, give it a go. Something in the back of my mind tells me the behaviour changes if not called from a submit but I can't remember exactly.
I keep the attachment, hidden from the user, because I always want to be able to refer to it so that if I need to change anything I'm always working with an original, and in terms of space I don't mind. But if you wanted to, there's no reason why you can't get a handle to the attachment and call a remove() on it. and saving again as part of the ImageUpload agent. It would make the database very lightweight.
remove() is in EmbeddedObject class, and there's an example of using it in the documentation. Remember to call a save - so do the remove after the mime objects have been created and then save after obviously.
George :)
Posted by R Ludwig on 10/11/2005 03:42:17 AMQuality of th resized images
Is there a option / setting to control the quality of the resized images
Posted by George MacDonald on 10/11/2005 01:33:03 PMControlling quality of resized images
Not in my code Richard - if you are using JPG is it a 'lossy' format anyway so resizing any image will result in degradation because each time it loses some of the detail. The better the original the better the resized copy. This is why I keep the original stored on the document as well as the MIME images.
JIMI will accommodate many other types of image - check out the documentation at http://java.sun.com/products/jimi/ - and it is extensible to accommodate image formats that are not built in so if you found, say, that you had better results with RAW types files you could use that as well as experimenting with GIFs etc. I've used JPG because it's available on every digital camera.
George :)
Posted by r r ludwig on 10/12/2005 01:29:03 AMQuality
Thanks george for your quick answer, found this information on
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/convertImage.html
1.3.3. Parameters supported by the Jimi image toolkit
Parameter Applies to output format Value Description
quality JPEG Number between 0 and 100. Controls the tradeoff between file size and image quality .
Posted by Chris Parkhouse on 02/25/2007 09:21:08 PMIs there anyway around the unrestricted agents requirement
Thank you for a fantastic agent. It works really well when I test it using 'Preview in web browser' however the unrestricted agent requirement means that it does not work on my hosted service at DominoDeveloperNetwork (and I really recommend their service - it is fantastic). They have suggested that the agent be modified to write to a specific directory for which my users would have open access. They tried modifying the Java for me - however this does not work (see log file below). I am not a java programmer - any ideas or help would be very much appreciated. Chris
23/02/2007 04:44:59 PM HTTP JVM: |
23/02/2007 04:44:59 PM HTTP JVM: /-------------------------------------------------
23/02/2007 04:44:59 PM HTTP JVM: imageUpload agent started
23/02/2007 04:44:59 PM HTTP JVM: |
23/02/2007 04:45:00 PM HTTP JVM: java.lang.SecurityException: not allowed to access or modify file: C:\WINDOWS\TEMP\eo114020868tm
23/02/2007 04:45:00 PM HTTP JVM: at lotus.notes.AgentSecurityManager.checkRead(AgentSecurityManager.java:768)
23/02/2007 04:45:00 PM HTTP JVM: at java.io.File.exists(File.java:701)
23/02/2007 04:45:00 PM HTTP JVM: at lotus.domino.local.EmbeddedObject.getTempFile(Unknown Source)
23/02/2007 04:45:00 PM HTTP JVM: at lotus.domino.local.EmbeddedObject.getInputStream
(Unknown Source)
23/02/2007 04:45:00 PM HTTP JVM: at ImageUpload.NotesMain(ImageUpload.java:56)
23/02/2007 04:45:00 PM HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)
23/02/2007 04:45:00 PM HTTP JVM: at lotus.domino.NotesThread.run(Unknown Source)
23/02/2007 04:45:00 PM HTTP JVM: |
23/02/2007 04:45:00 PM HTTP JVM: imageUpload agent finished
23/02/2007 04:45:00 PM HTTP JVM: -------------------------------------------------/
23/02/2007 04:45:00 PM HTTP JVM: |
Posted by George MacDonald on 02/26/2007 02:50:44 AMFile IO rights
Thanks - now then Chris - I don't think there is because even though it's a temporary file it's still file io and that's that. And I don't believe you can control where that io is happening because it's within the Domino environment.
I now don't use this method at all because on a Linux server the call to java graphics would regularly make the Domino JVM dump it's guts and crash the machine.
So now I use the excellent GraphicsMagick COM component on a Windows machine and it's totally stable and the quality of the converted images is much higher. I've also rewritten it to use LotusScript because I don't believe you can call and pass objects to a COM component from within Java.
In any case you're still going to have the same problem. Are the absolutely adamant about the agent security setting?
Posted by Chris Parkhouse on 02/26/2007 04:10:15 AMI'll get back to the Application Hoster
Hi George - thanks so much for the very fast response, I really appreciate it. I've sent a message back to DominoDeveloperNetwork to see if they can grant the unrestrict agent access as a special case. Thanks again
Posted by George MacDonald on 02/26/2007 04:40:41 AMA pleasure
No problem. I really suggest you take a look at GraphicsMagick but again there could be a rights issue because the COM object has to be registered under Windows before you can use it and they may or may not allow that either as it's a modification of their platform at operating system level.
I haven't got the time at the minute to upload a whole example but the essential bit of the code goes like this in LotusScript which might get you started.
Set responseDoc = db.CreateDocument
Call responseDoc.MakeResponse(parentDoc)
responseDocid = responseDoc.UniversalID
Set obj = doc.GetAttachment(fileName)
Call obj.ExtractFile( filePath + fileName )
Set img = CreateObject("ImageMagickObject.MagickImage.1")'
Call img.Convert( filePath+fileName ,"-resize","50" , filePath+thumb )
Call img.Convert( filePath+fileName ,"-resize","100" , filePath+home )
Call img.Convert( filePath+fileName ,"-resize","200" , filePath+medium )
Call img.Convert( filePath+fileName ,"-resize","500" , filePath+large )
Set rtitem = New NotesRichTextItem( responseDoc, "images" )
Dim object As NotesEmbeddedObject
Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", ""+filePath+thumb )
Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", ""+filePath+home )
Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", ""+filePath+medium )
Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", ""+filePath+large )
Kill ""+filePath+fileName+""
Kill ""+filePath+thumb+""
Kill ""+filePath+home+""
Kill ""+filePath+medium+""
Kill ""+filePath+large+""
'Remove the object so it's not saved on the parentDoc
Call obj.Remove
In this scenario I'm using response docs for each group of resized images to make the process a bit more relational. Then once they've finished adding the images I roll them up in the one doc and delete the response docs.
George.
Posted by Denis Frederic on 08/22/2007 09:04:12 AMJava Problem
I try to use this tools but i receive this on my Domino Console :
08/22/2007 15:03:02 HTTP JVM:
08/22/2007 15:03:02 HTTP JVM: /-------------------------------------------------
08/22/2007 15:03:02 HTTP JVM: imageUpload agent started
08/22/2007 15:03:02 HTTP JVM:
08/22/2007 15:03:02 HTTP JVM:
08/22/2007 15:03:02 HTTP JVM: imageUpload agent finished
08/22/2007 15:03:02 HTTP JVM: -------------------------------------------------/
08/22/2007 15:03:02 HTTP JVM:
08/22/2007 15:03:02 HTTP JVM: java.lang.UnsatisfiedLinkError: sun/awt/image/codec/JPEGImageDecoderImpl
08/22/2007 15:03:02 HTTP JVM: java/lang/Throwable.<init>(Ljava/lang/String;)V+4 (Throwable.java:85)
08/22/2007 15:03:02 HTTP JVM: java/lang/Error.<init>(Ljava/lang/String;)V+1 (Error.java:41)
08/22/2007 15:03:02 HTTP JVM: java/lang/LinkageError.<init>(Ljava/lang/String;)V+1 (LinkageError.java:34)
08/22/2007 15:03:02 HTTP JVM: java/lang/UnsatisfiedLinkError.<init>(Ljava/lang/String;)V+1 (UnsatisfiedLinkError.java:33)
08/22/2007 15:03:02 HTTP JVM: com/sun/image/codec/jpeg/JPEGCodec.createJPEGDecoder(Ljava/io/InputStream;)Lcom/sun/image/codec/jpeg/JPEGImageDecoder;+1 (JPEGCodec.java:50)
08/22/2007 15:03:02 HTTP JVM: ImageResizeToStream.createResizedImage(Llotus/domino/Session;Ljava/io/InputStream;I)Llotus/domino/Stream;+1 (ImageResizeToStream.java:22)
08/22/2007 15:03:02 HTTP JVM: ImageUpload.NotesMain()V+159 (ImageUpload.java:56)
08/22/2007 15:03:02 HTTP JVM: lotus/domino/AgentBase.runNotes()V+129(:??)
08/22/2007 15:03:02 HTTP JVM: lotus/domino/NotesThread.run()V+30 (NotesThread.java:215)
i think that java was not install om my Domino ?
how can i verify that Java is on Domino ?
how can i see the classpath in domino ?
...
Thank's to help
Posted by Juan F Donoso on 04/01/2009 11:00:09 AMDelete rtf contents when save
It works really well but when I edit the created document and Save it with the tipycal formula: @Command([FileSave]);@Command([FileCloseWindow]), the rtf content is deleted. Please help me.
Thanks in advance.
Juanfd