• Welcome to the new forum! We upgraded our forum software with a host of new boards, capabilities and features. It is also more secure.
    Jump in and join the conversation! You can learn more about the upgrade and new features here.

BS3 - Are there controls to add custom image?

Thunky

New Forum Member
Joined
Jun 17, 2018
Messages
1
Reaction score
0
In BS2 there were controls to "Set your own image for this recipe" and "Delete the image set for this recipe" which would replace the beer glass icon and color representation with a specified image file.

Is there a way to do this in BS3?  I have customized images set up in BS2 but am not able to reset to the default image in BS3.

Truthfully, I use this feature to edit recipes at work.  I replace the beer glass with a plain white background so it looks like I'm just working on a boring spreadsheet.  ;-)


 
I decided to remove that feature only because it never worked properly with the cloud (the images did not carry over properly) and honestly relatively few people used it.

Brad
 
I did the following to add a custom image to my reports, and it also works when you print it out. Unfortunately, it doesn't help in the Design view image.

**I'm a Windows user so this would need to be edited for Mac users. Hopefully someone here can help with the file paths and locations.
[If using BeerSmith2 replace BeerSmith3 with BeerSmith2]

For the Windows version, do the following:
1) Copy your images into the following folder location: C:\Users\[YourUserDirectory]\Documents\BeerSmith3\Reports

2) Add the code below to your Recipe report "NewRecipe.htm" add/or your Brew Steps report "NewBrewsheet.htm". I also use it for my custom reports.

3) In the "Taste Notes" text box, in the "Notes" section, type the file name you want to use with [* in front of the file name and followed with *] after the file name. Do not add a space in front or in back of the file name. (i.e. [*image.jpg*] )

Putting the [* *] around the file name will allow you to still use the "Taste Notes" field for any notes you want to add. If the tags are there, the script will pull it out of the text field regardless of what is in front or behind it and display that image.

The "NewRecipe.htm" and "NewBrewsheet.htm" files are in the C:\Program Files (x86)\BeerSmith3\Reports folder.

You can use note pad to edit the file. I recommend making a backup of the file first. Because of user rights, you may need to copy the file into another directory and then copy & replace the file back into the reports folder. When pasting the code, the format of the text may look different, but it still works.

In the report file, look for:

<img src='$GLASS' style="width:5.3em; height:9em;"/>

and replace it with the following text:

<script>
var varTasteNotes = "$TASTE_NOTES";
var varOpen = varTasteNotes.indexOf("[*");
var varClose = varTasteNotes.indexOf("*]");
var varCustomGlass = "";
varCustomGlass = varTasteNotes.substring(varOpen + 2, varClose);
var varFileExt = varCustomGlass.substring(varCustomGlass.lastIndexOf(".") + 1);
var varGlassSRM = "$GLASS".substring("$GLASS".lastIndexOf("/") + 1);
var varGlass = "file:///C:/Program%20Files%20(x86)/BeerSmith3/icons/" + varGlassSRM;
if (varFileExt == "png" || varFileExt == "jpg" || varFileExt == "gif"){
document.write('<img src=' + varCustomGlass + ' height="115" width="68" />');
} else {
document.write('<img src=' + varGlass + ' height="115" width="68" />');
}
</script>



Hope this works for you, Cheers!
 
I  miss this too from BS2! Used it all the time and never had a problem in the cloud recipe folder not seeing the picture.
 
I wish you could add images to the notes section.
 
Back
Top