image with uppercase file extension does not show up in thumbnail menu
  • If an image has .JPG then a black square with a play icon shows up in the thumbnail/preview menu when a gallery image is being viewed. If the black icon is clicked the image is displayed correctly, the only is issue the thumbnail/preview not showing up.

    The release notes mention something about toLowercase being removed, maybe there was one instance that it should have not been removed.

    Example: image

    Any hint on what line to change to fix this?
  • I have the same problem...

    But, if you change the *. JPG to *. jpg everything will be fine

    or fix the jquery.prettyPhoto.js
    line 719
    var results = regex.exec( pp_images[i] );
    to
    var results = regex.exec( (pp_images[i]).toLowerCase() );

    and everything will work great with jpg/JPG, gif/GIF ...
  • Worked perfect. Thx for the help.
  • Hi there,

    Thanks for the bug report, I'll fix it and update prettyPhoto :)
  • I face the same issue but my jpgs are not uppercase. Any idea what causes it. See http://burg.cx/products/gruner-veltliner-dac-golem-uibel

    Thanks Thomas
  • Hi,
    it is because your image links have an additional questionmark with some numbers added to the .jpg (e.g. .../Golem_06.jpg?1288249240). It will work when you remove the questionmark and numbers! What are these for?
    /cs.
  • Perhaps best to make the regex.exec case-insensitive by adding ,"i" like this: var regex = new RegExp("(.*?)\.(jpg|jpeg|png|gif)$", "i");
  • Hello same problem with but with all thumbnail/preview menu when a gallery image is being viewed.
    However my jpg are not in Uppercase.
    The image path is the following .

    http://url/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/s/c/screenshot5_5.jpg

    many tries but still this default_thumbnail.gif showing up.

    Thanks in advance and anyway thanks for developping this amazing script !


  • no one had the same issue as me ?

    Good day to all,

    Anselme
  • @CS
    Hi,
    I'm using Shopify as backend they inject the ?12323535, no way for me to change this behavior.

    @@frankholland you mean to edit something somewhere?

    Thanks Thomas
  • @frankholland added the "i" - still the same result, no thumbnails
  • Hello,

    I'm having the same problem with gallery view thumbnails showing up only as black play arrows; it doesn't seem to be an issue of upper or lower case.
    I can't figure out what the problem could be, after puzzling over it for hours. Anyone found an answer? Thanks,

    Chris
  • I figured it out... I actually did have some stray uppercase extensions, not in the image names but where I had copy-pasted some links. Everything is working beautifully.
    Thank you for this amazing script!!
  • I ran into the default thumbnail issue as well. The trailing ?12561235 is a timestamp, and is for caching purposes, its a _good_ thing to have as then you can update an image down the road, keeping the same filename but indicating that the image has been updated by having a different timestamp. This way you can set max expire times on images and avoid the user reloading all of your images.

    I had to update the thumbnail regex to be:

    var regex = new RegExp("(.*?)\.(jpg|jpeg|png|gif)(?:\\?[0-9]+)?$");

    This will just allow the timestamps to be there and still grab the appropriate thumbnail urls. I didn't see a github link on your page anywhere, otherwise I would have sent you a pull request with the change.


    -Russell
  • hi i'm using timthub resizing scrip and the trailing of the image is &w=800&zc=1 , how can i adjust the thumbnail regex to be able to get the right thumbnail urls?
  • I'm the same as you mrm, but using phpthumb. Anyone know of any solutions out there?
  • I just sent this off to mrm, but see it could be useful here as well:

    You would basically just need to make sure that everything past the image filetype is parameters. You could probably get away with adding: (?:[^/]+)? Just to make sure that there is no additional '/'s so for instance you wouldn't want to allow site.com/foo.jpg/bar, however that regex will allow something like site.com/foo.jpg.html which you need to be careful about, but as long as you're in control of the images going in it should be fine.

    So you would want to do something like:

    var regex = new RegExp("(.*?)\.(jpg|jpeg|png|gif)(?:\\?[^/]+)?$");

    P.S @ mrm Typo in the message I sent you, you this line here, this will work and ensure that its only matching on additional get parameters.


    -Russell
  • Also, FYI, the updated regex I used there does not suffer from the issue of matching on urls like site.com/foo.jpg.html so you should be fine to use it.


    -Russell
  • Chewbranca really appreciate your help. I have updated the regex value as per your suggestion but still getting: http://localhost/RONCHI/wp-content/themes/ronchi/thumb.php?src= http://localhost/RONCHI/wp-content/uploads/2010/12/7.jpg&w=800&zc=1 as trailing of image, so thumbnails not showing up. I'll try to upload something online, so easy for every one to check it out. Thanks
  • I tried updating the regex from

    var regex=new RegExp("(.*?)\.(jpg|jpeg|png|gif)$")

    to:

    var regex=new RegExp("(.*?)\.(jpg|jpeg|png|gif)(?:\\?[^/]+)?$");

    and no cigar either. Any other ideas chewbranca? Thanks for your help with this!
  • Has the trail gone cold on this one?
  • It can be fixed by changing jpg|jpeg|png|gif (as FickleLife mentioned) into jpg|jpeg|png|gif|JPG|JPEG|PNG|GIF. I know it is a quick-fix, and it should probably been refered to as some-kinda OR Capitals command, but this will do.
  • Thanks for your reply lg102, just tried that though and it's still not working.... not sure where to go from here....
  • thank you all, though i didn't get how to set allowed characters, at least
    var regex = new RegExp();
    worked..
  • Lovely this works great thanks ... spent 2 hours on it and couldnt figure out .. cheers guys
  • I am using `prettyphoto lightbox` to show pictures from the database.

    The thumbnails are all black with play icon on them and it's not showing the image.
    By the way, when you press one of this icons it refers you to the right image.
    You can see my site [here][1].

    In the browser URL , I am passing (e.g) : `Test2.aspx#prettyPhoto[44]/2/`
    from the fireBug i pulled out the image address:
    (with http in the start)
    'ImageHandler.ashx?ImID=44&isLogo=false&in=On%20Air%20Card'


    Please advise...
  • anyone??????
  • We are facing similar issue when our CMS is generating full size images without any extension, ie. src="a239789_11193.aspx?fm=0&&fitToSize=True"

    Is there any particular reason why PP is checking for extension and is it safe to remove this verification from script?

    Thanks!
  • hi
    sorry i mist it but i did what "manix" said
    change from :
    pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)
    to:
    pp_images[i].toLowerCase()
    and every thimg worked(!!)
    dumb me....:)
    thanks manix

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter