Dynamic Image As A email Signaure
Good Day All.
I have the following code the will randomly get an image from a folder.
It works Great.
Now what i would like to do is add that image as an inline image in my email signature.
eg
<img src="http://websiteadd/getsingle.cfm">
However this does not work.
here is the code of the CFM page.
<cfset imagesFolder = "#dirlocation##dirspace#images#dirspace#stock#dirspace#temp" />
<!--- code to look in directory, choose one image at random --->
<cfdirectory directory="#dirlocation##dirspace#images#dirspace#stock#dirspace#temp" filter="*.jpg" name="getPics" action="list"/>
<cfset maxrows = getPics.recordCount/>
<cfset startRow = randRange(1, maxrows)/>
<!--- if one or more photos was found --->
<cfif maxrows gt 0>
<div class="showPic">
<cfoutput query="getPics" startrow="#startRow#" maxrows="1">
<cfheader name="content-disposition" value="attachment; filename=#name#.jpg" />
<cfcontent file="#dirlocation##dirspace#images#dirspace#stock#dirspace#temp#dirspace##name#" type="image/jpg" />
<!---<cfimage action = "writeToBrowser" source="../images/stock/temp/#name#" format="jpg" />
<img src="../images/stock/temp/#name#"/>--->
</cfoutput>
</cfif>
Is there anyway to do this.
Regards
If your IMG tag always shows an image, then any HTML email sent via CFMAIL should work fine, BUT (and it's a big BUT) you have no control over the client who receives the email. They may refuse HTML emails, or they may block IMG tags (for privacy concerns). When you said "However this does not work" what did you mean? Please explain.
Creating a HTTP connection from the email to the image is also undesirable. It's probably better to embed the image, like this using a "data:" URL:
<cfset ImgFile = "d:\somefolder\images\myimage.png">
<cfset ImgHeader = "image/png;charset=utf-8;base64">
<cfset ImgData = ToBase64(FileReadBinary(ImgFile), "utf-8")>
<cfoutput>
<img src="data:#ImgHeader#,#ImgData#" alt="sig">
</cfoutput>
The data: URL includes the actual image within the IMG tag, so no outbound HTTP request to the image is required.
Similar Messages
-
Hello.
I'am actually using dynamic images depending of a filename and directory. This is working fine.
My problem is that my dummy image have a form (is in horizontal) and the dinamic images that i want to import to my template have multiple forms, i have images in vertical and images in horizontal and when i import an image that is in vertical , the image stays adjusted to my dummy image.
In this specific case , the customer have more than 20 companies with different logos ,of different forms, and when i import the logo to my template i want that the logo maintains his original form and not the form of the dummy image.
Anyone know if this is possible?
Thanks in Advance
Paulo Duarte
Edited by: user4256563 on 5/Mai/2011 10:24Send me the template, xml file and the image object file to [email protected] and I will take a look.
Thanks,
BIPuser -
Hi
I am trying to display images in 2 ways static and dynamic
unfortunately the dynamic display the last 2 doesn't show
anything
<mx:Image height="35" width="35" styleName="MediumIcon"
visible="{r.currentItem.extramedicine=='true'?true:false}"
source="@Embed('images/icon_extra-medicine.gif')"/> ->
Display Image
<mx:Image height="35" width="35" source="@Embed
('{r.currentItem.mood}')"/> -> Don't display image
<mx:Image height="35" width="35" source="@Embed
(source='{r.currentItem.mood}')"/> -> Don't display
image
mordsm"mordsm" <[email protected]> wrote in
message
news:gl6nqm$sso$[email protected]..
> Hi
>
> I am trying to display images in 2 ways static and
dynamic
> unfortunately the dynamic display the last 2 doesn't
show anything
>
>
> <mx:Image height="35" width="35"
styleName="MediumIcon"
>
visible="{r.currentItem.extramedicine=='true'?true:false}"
> source="@Embed('images/icon_extra-medicine.gif')"/>
-> Display Image
>
> <mx:Image height="35" width="35" source="@Embed
> ('{r.currentItem.mood}')"/> -> Don't display image
>
> <mx:Image height="35" width="35" source="@Embed
> (source='{r.currentItem.mood}')"/> -> Don't
display image
>
When you use @Embed the image is...embedded. That means it is
compiled into
the file, when it's not running. The compiler has _no_ idea
what the value
of your variable is expected to be at runtime.
Try
<mx:Image height="35" width="35"
source="{r.currentItem.mood}"/>
HTH;
Amy -
Hi!
I would like to generate dynamic images in a JSP which I would like do an "include" in other JSPs across the site. The reason for this is we show many emails/ phone numbers on various pages and with the prevalence of spiders/ robots, it would be better to not have it as HTML text. I saw a couple of sites displaying them as images but they were PHP and ASP.Net sites. Any suggestions?
Thanks!!Well... You could simply create 1 image per letter/number (this is done within a few minutes) and then code a function, which seperates the given string into chars and then creates HTML-code with the pictures.
There is an easier way, sure. But I don't know him :P. You know "Captchas"? The Codes you have to enter all over the internet to verify yourself as human and not as bot? If you google about ths code uses to create Captchas, you should be happy :)
X--spYro--X -
Hi,
I used dreamweaver, with php and server behaviors to bind
dynamic Image Alt Tags on dynamically generated images.
The dynamic image Alt Tags are showing in Internet Explorer
but not showing in Mozzila Firefox?
Does anyone know why or how to fix that?
MathumanThey are attributes, not tags. And the alt attribute is not
supposed to
show in any browser unless the user has disabled images for
faster
downloads. If you want a 'tooltip' effect, then you would
have to use the
title attribute, not the alt attribute to do that, e.g.,
<img src="foo.jpg" alt="this will not display" title="this
will display" />
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"mathuman" <[email protected]> wrote in
message
news:ghqmnv$i0h$[email protected]..
> Hi,
>
> I used dreamweaver, with php and server behaviors to
bind dynamic Image
> Alt
> Tags on dynamically generated images.
>
> The dynamic image Alt Tags are showing in Internet
Explorer but not
> showing in
> Mozzila Firefox?
>
> Does anyone know why or how to fix that?
>
> Mathuman
> -
Sharing/Caching (Dynamic) Images
I find that the Flash Player does not cache dynamic images
(even in the same session), so my question is, how would I share
images across multiple image components such that I can build an
asset provider of sorts to assit with caching images and other
assets?
I've tried a simplistic approach where in I assign the source
of one image component to another but then the first image
component goes blank and the image "transfers" to the second.
Not sure if BitmapData will help with this either.
Any help/direction is much appreciated.
Thanks.
Shiv.URL? Code?
Nancy Gill
Adobe Community Expert
Author: Dreamweaver 8 e-book for the DMX Zone
Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
2003)
Technical Editor: Dreamweaver CS3: The Missing Manual,
DMX 2004: The Complete Reference, DMX 2004: A Beginner's
Guide
Mastering Macromedia Contribute
Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
Web Development
"kidcobra" <[email protected]> wrote in
message
news:g2oqb0$bgq$[email protected]..
> PHP, dynamic images from mysql dbase....diplay on local
server, but will
> only
> display on web server if in the same level or folder as
the php page.
> Locally,
> I have put the path to the images in the dbase in front
of the URL of the
> image, and all works fine.... but with that path in
there and images not
> in
> same folder as page, no web server display. I know I'm
missing the
> obvious, but
> need help if anyone has the simple answer . Thanks
> -
Hi, does anyone know of a free dynamic popup extension out
there? So far the other image extensions I have found all require a
.jpg file. I am using it for a dynamic page and need to use it with
a dynamic attribute <img src="#photos.primaryImage1#">.
Thanks
ShaneAs a follow-up, Shane tells me that he got the extension to
work on the
detail page by cushioning the code with cfoutput tags. Glad
you got it
working Shane.
Shameless plug:
http://www.communitymx.com/abstract.cfm?cid=A8B18F40A0806AB8
Bill Horvath
Free Tutorials for All Macromedia Products
http://www.communitymx.com/free.cfm
Free 10 Day Trial
http://www.communitymx.com/joincmx.cfm
"Shane930" <[email protected]> wrote in
message
news:e1meu0$2rk$[email protected]..
> Well it looks like there are two extensions that will do
part of the job
> for
> what I want. The first on is CMXCFPopup.mxp by Bill
Horvath. This one is
> $3.00 and it works fine with my repeating region page
but it does not work
> so
> far with a detail page that has multiple dynamic images.
>
> The second one is dbJustSoPWbMX.mxp by E. Michael
Brandt. The problem
> with
> this one is that the extension is only written for ASP
currently. I have
> emailed Michael to see if there is a chance he will
update it to CF.
>
> Thanks
>
> Shane
> -
Dynamic image is not being displayed in Adobe Reader 8.1
Hi,
In interactive form, we have followed below required steps to show a dynamic image.
For the left image, drag and drop an Image Field element from the standard Library tab to the Body Pages pane. Select this image field and edit the following properties:
Click on the Layout tab and choose None for the Caption position.
Click on the Object, then the Binding tab and choose None for Default Binding.
Click on the Field tab, enter $record.SapOnlineShopUrl for the URL entry, and select Use Image Size for the Sizing field.
Click on the script editor and enter the following FormCalc script statement, which enables the dynamic integration of the image. Show: initialize Script: this.value.image.href = xfa.resolveNode(this.value.image.href).value;
Language: FormCalc Run At: Client
Image is displayed properly in Adobe reader 7.1 but it's not being displayed in Adobe reader 8.1.
I was going through some forums and understand that Adobe 8.1 blocks href URL. If this is indeed true, what's the alternative way to show a dynamic image?
Regards
Chandra
Edited by: Chandrashekhar Singh on Apr 24, 2008 7:28 AMSoory, I thought its static image....
Regards,
Vaibhav Tiwari.
Edited by: Vaibhav Tiwari on Apr 24, 2008 11:45 AM -
Dynamic image in the template builder plug-in does not work
Hi all,
The documentation says:
Direct Insertion
Insert the jpg, gif, or png image directly in your template.
+...This works obviously+
URL Reference
1. Insert a dummy image in your template.
2. In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:
url:{'http://image location'}
For example, enter: url:{'http://www.oracle.com/images/ora_log.gif'}
+...This works too when I hardcode an url as url:{'http://www.google.com.tr/images/firefox/mobiledownload.png'}+
Element Reference from XML File
1. Insert a dummy image in your template.
2. In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:
url:{IMAGE_LOCATION}
where IMAGE_LOCATION is an element from your XML file that holds the full URL to the image.
+...This, however, does not work.+
I use Apex' report query tool and My query is like
select 'http://www.google.com.tr/images/firefox/mobiledownload.png' IMAGE_LOCATION from ... (a single result set for my template)
the xml data is generated with an IMAGE_LOCATION tag. I load it to word template plug-in. The Url successfully displays in the report if I make it a plain-simple field.
But when it's in the image format->web->alt text as url:{IMAGE_LOCATION} no image displayed.
I need to keep this design procedure simple so a simple word user could design a report via using just template builder plug-in. I don't wish to explore the xsl-fo area...yet.
Could you tell me why I can't get this url:{IMAGE_LOCATION} to work?
Regards
PS: My BI version: 10.1.3.4.1
Edited by: oeren on Jun 8, 2011 12:28 AMOeren,
I stumbled across this little tidbit buried in the BI Publisher forum: Dynamic Images in rtf
Glad you are up and running!
Joshua -
How to display a dynamic image file from url?
Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
//PlayJpg.java:
import java.awt.*;
import java.applet.*;
import java.net.*;
public class PlayJpg extends Applet implements Runnable {
public static void main(String args[]) {
Frame F=new Frame("My Applet/Application Window");
F.setSize(480, 240);
PlayJpg A = new PlayJpg();
F.add(A);
A.start(); // Web browser calls start() automatically
// A.init(); - we skip calling it this time
// because it contains only Applet specific tasks.
F.setVisible(true);
Thread count = null;
String urlStr = null;
int sleepTime = 0;
Image image = null;
// called only for an applet - unless called explicitely by an appliaction
public void init() {
sleepTime = Integer.parseInt(getParameter("refreshTime"));
urlStr = getParameter("jpgFile");
// called only for an applet - unless called explicitely by an appliaction
public void start() {
count=(new Thread(this));
count.start();
// called only for applet when the browser leaves the web page
public void stop() {
count=null;
public void paint(Graphics g) {
try{
URL location=new URL(urlStr);
image = getToolkit().getImage(location);
}catch (MalformedURLException mue) {
showStatus (mue.toString());
}catch(Exception e){
System.out.println("Sorry. System Caught Exception in paint().");
System.out.println("e.getMessage():" + e.getMessage());
System.out.println("e.toString():" + e.toString());
System.out.println("e.printStackTrace():" );
e.printStackTrace();
if (image!=null) g.drawImage(image,1,1,320,240,this);
// called each time the display needs to be repainted
public void run() {
while (count==Thread.currentThread()) {
try {
Thread.currentThread().sleep(sleepTime*1000);
} catch(Exception e) {}
repaint(); // forces update of the screen
// end of PlayJpg.java
My Html file looks like here:
<html>
<applet code="PlayJpg.class" width=320 height=240>
<param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
<param name=refreshTime value="1">
</applet>
</html>
I only get the first frame picture for ever by my html.But the jpg file is dynamic.
Why?
Can you help me?
Thanks.
JoeHi,
Add this line inside your run() method, right before your call to repaint():
if (image != null) {image.flush();}Hope this helps,
Kurt. -
How do get a dynamic image to open in new browser window
I'm using DW CS3, mysql (MAMP) OS 10.6.2 I'm designing my online store. I need the customer to be able to click dynamic image/thumbnails to view a larger image in a new browser pop up window 400 x 400. An example of this functionality can be seen at :
http://www.designpublic.com/spot-on-square-roh-dresser
So far I can get the separate new browser window to open with the dynamic image, using the open new browser behavior, but the on click also advances to next page with the larger image. You have to press the back button to get back to the product page. I want the customer to be able to see the product page , while viewing larger image, and then close larger image, and still have the product page open. I don't understand why 2 windows are opening.
Thanks for the help people!
WilliamHi
I did look at it but, (and this is only my opinion, I do not like such effects) it is your decision.
If you view source you will see -
<a href="#" onclick="popWin('http://www.designpublic.com/catalog/product/gallery/id/12706/image/91883/', 'gallery', 'width=300,height=300,left=50,top=50,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="Spot on Square Roh Dresser" class="gallery-image-link"><img src="http://arcsmedia01.s3.amazonaws.com/catalog/product/cache/2/thumbnail/56x56/5e06319eda06f020e43594a9c230972d/r/o/roh_dresser1.jpg" alt="" /></a>
Which is controlled by the javascript function
popWin()
which you can view using the firefoxe dev toolbar - view javascript function.
PZ -
Dynamic Image Displays Blank When Using In Visual Studio Project
I am trying to simply display a dynamic image in a report. I am using Crystal Reports XI Release 2.
I have two different environments: Local via Progress where reports are called using Crystal Viewer ActiveX, and over the web where reports are called from Open Laszlo and Visual Studio project.
The image is set to a blank image as default, and Graphic Location Forumla loads the image from the database (site.logo_location + site.logo_filename) which results in an image http:
www.vetinfo3.com\a.jpg.
When I run the reports locally using the ActiveX control, it works just fine and displays the image.
When I run over the web using OpenLaszlo, it displays a blank.
Troubleshooting
We are using Visual Studio 2005, which is bundled with an older version of Crystal that doesn't support dynamic images.
To address this, I loaded Crystal XI Release 2, which updated the version in Visual Studio and enabled the Graphic Location formula field on the dev machine.
I verified the Graphic Location field was set correctly.
This caused a Version error, so we loaded cr_net_2005_mm_mlb_x86.zip on server and specified the Version in web.Config.
No errors now, but when I build and publish the code, the image still displays as blank.
From Fiddler
GET http://www.vetinfo3.com/mdsol1/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_c5d6a923-293b-4f1e-8739-4e698f83b087.png
Creates C:\Documents and Settings\Curtis\Local Settings\Temporary Internet Files\Content.IE5\PWRUX2XW\CrystalImageHandler[1].png
Blank Image
According to issues within Visual Studio, they say the fix to this is to add the <httpHandler> in web.Config, but it is already there; added when we add the viewer to the project:
In web.Config I have some questions about this line:
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
There are more service packs for Crystal XI Release 2:
crXIr2sp2_net_server_install.zip
crXIr2sp3_net_server_install.zip
crXIr2sp4_net_server_install.zip
I have not loaded these yet, but the readme files do not indicate they fix any dynamic image issues.
I am out of ideas on this; does anyone have any ideas?What about if you take OpenLaszlo out of the picture? E.g.; use one of our samples from here;
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
I'd recommend vbnet_web_simplepreviewreport
Also, see [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0437ea8-97d2-2b10-2795-c202a76a5e80] article.
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup -
Hi,
I want to create Badges from employee table (ID, NAME, JOB_TITLE, PHOTO). I downloaded and installed a demo application "USING DYNAMIC IMAGES IN PDF REPORT". It works fine with smale images < 20K. I'm getting the following error for images > 20K :
"ORA-06502: PL/SQL: numeric or value error: raw variable length too long"
it seems like a buffer problem.
could you pls help to solve this problem
Thanks,
RibhiHi Carsten
That was exactly* I was looking for. Maybe I should Google more in German ;-)
The main problem was that I defined my image outside the first repeating group (that doesn't repeat, it's always just one object) - the first group is followed by 7 more.
Just like the "Name" (that's positioned outside the group in the document header), I positioned the image above the table representing the group.
Doing that, the "Name" is filled correctly, the Image only when the Output Format is Excel or HTML - not Word or PDF ... makes no sense but that's tje way it is.
After moving the image inside the group....it works great!
(One more thing...the image size is fixed to the image you use as "dummy". Is there any way to make that more flexible, because now some scaling happens...)???
@Trent: That was the way we initially did it, but when the size of the row exceeds 32K...you know what happens.. And even with a small image the 32K limit is hit easily
The way I use it now (very similar to Carsten's description) there is no limit....
Thank you all!
Roel -
Dynamic Images in Crystal Reports
I have a report with Dynamic Images. I am able to run the report but once I try to export it or try to browse through the pages I get the following error:
Application popup: Crystal Reports - [Inventory Graphics Report.rpt]: crw32.exe - Application Error : The exception Integer division by zero.
(0xc0000094) occurred in the application at location 0x2c03a410.Hi Don,
I have read your response 10 times, but I don't really understand it.
"Your only option is to use the Insert OLE Object or picture into the report" - fine, but how is this achieved from a dataset?
"CR will not display BLOB fields as pictures" - fine, but maybe I used the word BLOB badly. The dataset column datatype is "byte[]". Will CR display byte[] columns as pictures?
"You can use a database field to point to which picture file to use, then you won't be using up valuable memory space importing the images into your data set. And the Logo's now dynamic...." - this seems to suggest that the database field is a string storing the file location on disk. Yes? I don't care about memory space in this case and I'm happy to load a binary file into a byte[] column if there is a way of displaying it.
So, if I understand correctly, you're suggesting the dataset contain a table.row.column which stores the filelocation. How do I convert that to display as a picture (dynamically)?
Robert -
Showing dynamic images in BI Publisher PDF report
I defined a RTF report layout in BI Publisher. Almost done, but one requirement missing...
I should be able to include a dynamic image (so every "object" on the report has it's own image).
At first I embedded the base64 converted image in the XML output, but then I am running into the 32K limit. (Small pictures render fine).
Although Marc Sewtz sort of promised in June 2008 (!) : "One issue, which we'll address in the next version of Application Express, is the 32k limit on report columns." on his blogpost http://marcsewtz.blogspot.com/2008/06/one-question-about-pdf-printing-feature.html , it still not addressed.
So I tried to embed the image in the report using a trick described on the forum (and BIP documentation), by embedding a dummy picture and set the "Alt-text" of the picture to
(as an example) : url:{'http://www.oracleimg.com/us/assets/oralogo-small.gif'}.
The strange thing is, that works fine for HTML Output and Excel output, but not for Word and PDF (why it does work for Excel and not for Word is very mysterious....). And of course I need a PDF output.
I also tried to embed a FO snippet:
<fo:block>
<fo:external-graphic src="url:{'http://www.oracleimg.com/us/assets/oralogo-small.gif'}" />
</fo:block>
But that doesn't (seem to) work on any output...
But
<fo:block>
<fo:external-graphic src="D:\Users\rhartman\Documents\PrintScreen Files\Screenshot004.jpg" />
</fo:block>
does produce the image on the PDF output.
So who has an idea how to solve this issue?? You'll be rewarded with a lot of pionts ;-)
TIA
RoelHi Carsten
That was exactly* I was looking for. Maybe I should Google more in German ;-)
The main problem was that I defined my image outside the first repeating group (that doesn't repeat, it's always just one object) - the first group is followed by 7 more.
Just like the "Name" (that's positioned outside the group in the document header), I positioned the image above the table representing the group.
Doing that, the "Name" is filled correctly, the Image only when the Output Format is Excel or HTML - not Word or PDF ... makes no sense but that's tje way it is.
After moving the image inside the group....it works great!
(One more thing...the image size is fixed to the image you use as "dummy". Is there any way to make that more flexible, because now some scaling happens...)???
@Trent: That was the way we initially did it, but when the size of the row exceeds 32K...you know what happens.. And even with a small image the 32K limit is hit easily
The way I use it now (very similar to Carsten's description) there is no limit....
Thank you all!
Roel
Maybe you are looking for
-
Hi All, I have layout which has following columns : Line- Item -Part number- Qty -Unit When Item description is too long it is displaying in next page. I mean half in 1 st page half part in second page. So what i want is instead of displaying this li
-
In the new ios7 update, why can't you mark all your messages in the inbox all at once? The EDIT tab lets you Mark All and off to the right is greyed out "move" and "trash", why can't you Select all and then press TRASH. It only lets you mark them a
-
Passing values to next page on Update image click?
Hi Everyone, I have developed one OAF page which has onw table data to show. The last column is Update Image icon. Columns are like this: Eno, enmae, comm, address, salary, update. On clicking on update icon on any row the corresponding Eno and Ename
-
Hi!! How can I pass a method as parameter to other method? Is there any class that represents a methos like, for example, HelloWorld? Thanks everybody!!
-
ColdFusion10 Multi-instance cfform problems
Hello, I am working with a client on an issue regarding cfform ( flash ) on a coldfusion10 server with multiple instances. We have multiple instances setup as a cluster. We then replicate all sandbox security settings to both instances. However, one