14 Replies Latest reply: Oct 25, 2011 9:51 AM by rschletty RSS

    Keep original file names in HTML Web Gallery

    MarkDas Community Member

      When creating an HTML Web Gallery (using  ‘Lightroom’ template), Bridge CS5 renames the thumbs and large images to  an arbitrary number.  The caption reads as the original file name, but  the actual image has a new name.  This is problematic, as my clients  will right-click selected images from my galleries to save and forward  for approval, but the file name is not the same as the original.

       

      As an example: VLNK0321.jpg  is renamed as _4856316150.jpg.  (In Preferences/Output, the "Convert  multi-byte file names to Full ASCII" is unchecked.)

       

      Is  there any way to fix this little (for me and other shooters--BIG) problem?  Please help, Adobe!  I would imagine that the script could be changed to keep the original file name...  Any help would be greatly appreciated.

        • 1. Re: Keep original file names in HTML Web Gallery
          MarkDas Community Member

          Ok, I'm not a coder, but have enough street-smarts to have found the script that's doing the renaming.  I could--and might have to--through trial and error, figure out the fix myself, but if anybody could help, here's where the culprit script is:

           

          C:\Program Files\Common Files\Adobe\Bridge CS5 Extensions\Adobe Output Module\mediagallery\resources\htmlgallery\cutName.js

           

          I'd greatly appreciate anyone's help here.  Here's the current text of "cutName.js":

           

          function getName(name){
              var len;
              var i;
              var displayName = "";
              for (i = 0; i < name.length; i++) {
                  var hexValue = name.charCodeAt(i);
                  var value = parseInt(hexValue, 10);
                  if (value == 32)
                      displayName += " ";
                  else
                      displayName += name.substr(i, 1);               
                  var table = document.createElement("table");
                  table.style.visibility = "hidden";
                  var body = document.createElement("tbody");
                  table.appendChild(body);
                  var tr = document.createElement("tr");
                  body.appendChild(tr);
                  var td = document.createElement("td");
                  td.setAttribute("noWrap","true");
                  td.setAttribute("text-align","center");
                  td.innerHTML = "<font size=\"2\">" + displayName + "</font>";
                  tr.appendChild(td);
                  document.body.insertBefore(table, null);
                  len = td.offsetWidth;
                  try {
                      table.parentNode.removeChild(table);
                  } catch (e) {}
                  if (len >= 150) {
                      break;
                  }
              }
              if (i != name.length) {
                  displayName = "";
                  for (i = 0; i < name.length; i++) {
                      var lastName = displayName;
                      var hexValue = name.charCodeAt(i);
                      var value = parseInt(hexValue, 10);
                      if (value == 32)
                          displayName += " ";
                      else
                          displayName += name.substr(i, 1);
                      var table = document.createElement("table");
                      table.style.visibility = "hidden";
                      var body = document.createElement("tbody");
                      table.appendChild(body);
                      var tr = document.createElement("tr");
                      body.appendChild(tr);
                      var td = document.createElement("td");
                      td.setAttribute("noWrap","true");
                      td.setAttribute("text-align","center");
                      td.innerHTML = "<font size=\"2\">" + displayName + "...</font>";
                      tr.appendChild(td);
                      document.body.insertBefore(table, null);
                      len = td.offsetWidth;
                      try {
                          table.parentNode.removeChild(table);
                      } catch (e) {}
                      if (len >= 150) {
                          displayName = lastName + "...";
                          break;
                      }
                  }
              }
              return displayName;
          }
          function addSpace(name, width)
          {
              var displayName = "";
              for (var i = 0; i < name.length; i++) {
                  var table = document.createElement("table");
                  table.style.visibility = "hidden";
                  var body = document.createElement("tbody");
                  table.appendChild(body);
                  var tr = document.createElement("tr");
                  body.appendChild(tr);
                  var td = document.createElement("td");
                  td.width = width;
                  td.setAttribute("word-break","break-all");
                  td.setAttribute("text-align","center");
                  td.innerHTML = "<font size=\"3\">" + displayName + name.substr(i, 1) + "</font>";
                  tr.appendChild(td);
                  document.body.insertBefore(table, null);
                  var len = td.offsetWidth;
                  try {
                      table.parentNode.removeChild(table);
                  } catch (e) {}
                  if (len > width) {
                      displayName += " ";
                  }
                  displayName += name.substr(i, 1);
              }
              return displayName;
          }

          • 2. Re: Keep original file names in HTML Web Gallery
            Curt Y Community Member

            This post may be of no help, but seem to remember

            some post similar to this several months ago.  My memory could be

            wrong, but seems like I remember the problem with a permission issue on a network drive.  Since it did not have write permission it had to write in another place and the name was changed.  Are you using a network drive.?

            • 3. Re: Keep original file names in HTML Web Gallery
              MarkDas Community Member

              Thanks for your reply, Curt.

               

              Nope, it's not a network drive.  I've read the post you refer to as well, and I don't think that's really the issue.


              I suggest you try outputting a gallery and see if it doesn't rename your image names as well. I'm sure it will...

               

              Again, the disply name will be correct, but the actual file name when you try to save the image from the gallery will be different.

               

              It's apparantly an intentional thing that Adobe has written into CS5.  Other photographer friends complain about it as well, as it really 'kills the deal' in HTML galleries. If I didn't want my images copied and saved, I'd simply make a Flash gallery instead.

              The Adobe script posted above is even named "cutName.js," showing clear intent on behalf of Adobe to do just that

              .

              I've since played a bit with some alterations in the script, and had some success on altering the output of the finished gallery, but since I'm not a coder, it's all trial and error for me...

              • 4. Re: Keep original file names in HTML Web Gallery
                Curt Y Community Member

                Never tried a web gallary, don't even know how to do it.

                 

                Might visit the Bridge Scrips forum and see what they say.  http://forums.adobe.com/community/bridge/bridge_scripting

                • 5. Re: Keep original file names in HTML Web Gallery
                  chaoxie Community Member

                  Hi Mark

                   

                  This renaming behavior is by designed in Bridge CS5 but since many customer don't want that so now we are considering changing on this. thanks!

                  • 6. Re: Keep original file names in HTML Web Gallery
                    MarkDas Community Member

                    Hi Chaoxie,

                     

                    Thanks for your reply.  I'm assuming you're an Adobe employee by your response.  If so, I can't stress enough the urgency behind this needed fix...

                     

                    Bridge CS5 is otherwise nearly perfect.  The speed with which it handles RAW conversions, the controls over image manipulation within RAW, the speed with which web galleries from RAW files are made are all amazing.  The "look" of the HTML Lightroom web gallery is gorgeous.

                     

                    The problem is, EVERY client of mine has complained about the renaming.  It's so bad that it's actually angered some very long-time and very loyal commercial customers, and I've since had to revert to making web galleries in Photoshop.  But for whatever reason, making the galleries the old way in Photoshop is agonizingly slow, taking about 10 times as long as within Bridge CS5.

                     

                    So I'm asking that, while we wait for Adobe to fix the problem in an update, could you possibly fix the script above so that the re-naming doesn't occur, and post it ASAP, so I and others can implement the fix without waiting for a formal update?

                     

                    Your help is GREATLY appreciated...  Thanks Adobe.

                    • 7. Re: Keep original file names in HTML Web Gallery
                      jackthegiantslayer Community Member

                      Yes, this is a huge problem for me too. What on earth were Adobe developers thinking, renaming the files?!?!? I use these galleries to generate download links for larger resolution images that clients can download, and clients want the file named the way I NAMED THEM. WTF?

                      • 8. Re: Keep original file names in HTML Web Gallery
                        grape jan Community Member

                        I agree -- please please fix this problem soon. Not having the right file names on the html files is slowing my production time waaaay down!  I anxiously await this fix!

                        • 9. Re: Keep original file names in HTML Web Gallery
                          PolarMedia.ca Community Member

                          Same problem here... !!

                          I like Bridge CS5, but their is 2 major problems that are slowing me down in a day, they are :

                          - output for web file renaming (don't want that at all)

                          - impossibility to add a simple watermark/copyrigt to image when output for web (it was so simple back to Photoshop CS1, now I have to go by Lightroom do get this)

                          • 10. Re: Keep original file names in HTML Web Gallery
                            G0B0T Community Member

                            Four years ago we were all better off with "web photo gallery" within Photoshop. It was simple, quick, painless and fast. Heck, we could even tweak the scripts and create custom layouts.

                             

                            Then Bridge came along, stole it and broke it. Who's driving the ship here? Captain *******' Kangaroo?

                             

                            To get back to the good olde days:

                             

                            Web Photo Gallery in Photoshop CS4

                            http://www.gieson.com/Library/projects/utilities/photoshop/index.html

                             

                            See also:

                             

                            Quick Gallery

                            http://www.gieson.com/Library/projects/utilities/QuickGallery/index.html

                            • 11. SOLVED: Keep original file names in HTML Web Gallery
                              MarkDas Community Member

                              Hi G0B0T,

                               

                              Thanks for the suggestion.  Problems with that are:

                               

                              You must first convert your raw files to JPEGs, then wait for an agonizingly slow processing in PS.  I love the way CS5 can take all of your adjusted/corrected RAW images and make a much more aesthically pleasing HTML gallery in mere seconds, even with hundreds of RAW originals.

                               

                              Fortunately, I've figured out the solution.  This will still leave you with an "underscore" leading off the filename, but will otherwise return the original file name to the actual JPEG file (both thumb and large) within the gallery...

                               

                              This works for Windows.  I imagine the Mac solution is similar. Props to William Zauscher for helping to write the code.


                              I take no responsibliity for any damage caused to your computer, Photoshop or Bridge in implementing the following...


                              In Windows, browse to C:\Program Files\Common Files\Adobe\Bridge CS5 Extensions\Adobe  Output Module\mediagallery\resources\scripts


                              In the file named "galleryCreator.jsxinc" find and replace the lines:


                              AOM.AmgGalleryCreator.createUniqueFileName = function(filePath, jpgFile,  createMode)
                              {
                                  var alteredName;
                                  while (true)
                                  {
                                       alteredName = "_";
                                      for (var i=0; i<10; i++)
                                      {
                                           alteredName += Math.floor(Math.random() * 10);
                                      }
                                       alteredName += ".jpg";
                                      var f = new File(filePath +  alteredName);
                                      if (!f.exists)
                                          break;
                                  }
                                   return alteredName;
                              }


                              ...with the following:


                               

                              AOM.AmgGalleryCreator.createUniqueFileName = function(filePath, jpgFile, createMode)

                              {

                                              var alteredName;

                                              while (true)

                                              {

                                                              alteredName = "_";

                                                              alteredName += jpgFile += ".jpg";

                                                              var f = new File(filePath + alteredName);

                                                              if (!f.exists)

                                                                              break;

                                              }

                                              return alteredName;

                              }

                               

                              You can cut and paste the above.  Obviously, save a version of the original file somewhere in case of screwups...

                               

                              Cheers!

                               

                              -Mark

                              • 12. Re: Keep original file names in HTML Web Gallery
                                PolarMedia.ca Community Member

                                scripts... codes... hacks... plugins...

                                All okay options, but hey, hello Adobe! I've payed arround 2 000 $ for this software. Any chance that you find the real permanent solution ?

                                ...getting inspired by some solutions here, and then send us all a fix to it or an update ?

                                Thanks.

                                • 13. Re: SOLVED: Keep original file names in HTML Web Gallery
                                  Adam Read Community Member

                                  That hack to the galleryCreator.jsxinc file worked for me.  However, I changed the alteredName = "_"; to alteredName = ""; to get rid of the leading underscores.  My server is set up to not serve any file that begins with an underscore.  I started doing this so that Dreamweaver design notes didn't get served but found it useful for other things as well, like coldfusion includes.

                                   

                                  Thanks,

                                  • 14. Re: SOLVED: Keep original file names in HTML Web Gallery
                                    rschletty Community Member

                                    I also need a real and immediate fix to this problem of renaming files. My files were carefully named using A Better Finder Rename by Frank Reiff. Why should Adobe think that I want my photos renamed to  cryptic, meaningless character strings?

                                     

                                    I will do the hack to the galleryCreator.jsxinc but that is not a happy thing to have to do when I have paid so much for CS 5 and 5.5.