Search…

X3 Photo Gallery Support Forums

Search…
 
sopax
Experienced
Topic Author
Posts: 36
Joined: 20 Feb 2009, 09:19

Upload pdf-file

02 Jun 2017, 13:10

In Settings - Content I have some text about the gallery. I would like to have also a link to a PDF-file (which I have uploaded to the Gallery). I have not been able to find a way to do this - any help, pls?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12249
Joined: 30 Sep 2006, 03:37

Re: Upload pdf-file

02 Jun 2017, 14:11

Yes, use the dynamic {{path}} to help create a link to your PDF file. For example, in your content, use markdown:
Code
[Click to view PDF]({{path}}filename.pdf)
Or plain html:
Code
<a href="{{path}}filename.pdf" target=_"blank">Click to view PDF</a>
The {{path}} variable creates a dynamic file path to the physical location of the folder, which may often be something like /content/2.holiday/4.hongkong/, eg. different from the actual URL.
 
sopax
Experienced
Topic Author
Posts: 36
Joined: 20 Feb 2009, 09:19

Re: Upload pdf-file

03 Jun 2017, 13:31

Thanks Karl. However something goes wrong, because the pdf-file opens in the same window (and not in the target=_blank.)  This goes for both codes. I want it to open in a separate window. This is the link to the page: http://sopax.dk/X3/rejser/Sri-Lanka-Maldiverne-2017/. The pdf-file is named Rejsebrev1 and is near the top.
You may also observe that the Auto Image Orientation does not work on this page (although somehow it seems to work on the other test page http://sopax.dk/X3/anja/1987/. Will the manual rotation option be included in the next update?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12249
Joined: 30 Sep 2006, 03:37

Re: Upload pdf-file

03 Jun 2017, 16:27

sopax wrote:Thanks Karl. However something goes wrong, because the pdf-file opens in the same window (and not in the target=_blank.)
For some reason, your target code comes out like this:
Code
target="_"blank""
It should be:
Code
target="_blank"
Did an extra quotation mark sneak in somewhere in your code? Are you sure you are using proper typed quotations on both sides and not mixing ”"'?
sopax wrote:This goes for both codes.
Only the HTML supports adding target attribute. Markdown does not add any target, so you need to use HTML if you want to apply a target to a link.
sopax wrote:You may also observe that the Auto Image Orientation does not work on this page (although somehow it seems to work on the other test page http://sopax.dk/X3/anja/1987/.
I will take a look into this tomorrow.

Would it not be an idea to run all your images through a lossless EXIF-rotation correction tool prior to upload? For example http://annystudio.com/software/jpeglosslessrotator/.  On the other hand, I find it strange that this camera has not set correct rotation for the image when it was taken.
 
sopax
Experienced
Topic Author
Posts: 36
Joined: 20 Feb 2009, 09:19

Re: Upload pdf-file

04 Jun 2017, 13:24

I copied your code of 6.11pm, where the "" were differently placed. It is now working fine - thanks.

I have presented the problem for the manufacturer of my camera. However the images are shown correctly on several photo-software (Adobe Bridge, Photoshop, Picasa). I cannot use anny, as this is only for windows, and I have mac. I had the same problem with X2 (when I was using another camera), but it was easily corrected with the rotate-arrows.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12249
Joined: 30 Sep 2006, 03:37

Re: Upload pdf-file

04 Jun 2017, 14:16

sopax wrote:I have presented the problem for the manufacturer of my camera. However the images are shown correctly on several photo-software (Adobe Bridge, Photoshop, Picasa).
This is normal. All desktop applications will read the EXIF info inside the image, and rotate the image appropriately when viewing. Even the BROWSER can read the EXIF rotation value, and rotate the image correctly for viewing, when accessed DIRECTLY by URL. Check your image:
http://sopax.dk/X3/content/3.rejser/1.S ... nka039.JPG

HOWEVER, when the image is viewed inside a html page (for example X3), the browser will NOT rotate the image based on EXIF tags unfortunately. This is nothing to do with X3, and we can't force the image to "rotate" correctly ...

To conclude:
  • There is nothing inherently "wrong" with your image. It's certainly not your fault  :grimacing: Rotation is stored inside EXIF tags, and any (at least most) desktop applications/apps, will be able to display the image correctly (by reading the image EXIF tags, and rotating the image correctly for viewing).
  • However, the BROWSER can not rotate the image to display correctly (unless accessed directly, as in the link above).
  • MOST cameras (including smartphones), will physically rotate the image according to how it was taken. The reason why SOME manufacturers (including your camera) would choose to not do this, is because it requires more processing power (it likely takes slightly more time to save the image to camera).
  • The problem we are left with, is that it is simply IMPOSSIBLE to display this image correctly rotated inside a web page. Unless of course either A) the image is rotated correctly prior to upload, or B ) the image is rotated programmatically by server PHP script (which would have to be done by the panel, and would cause re-compressing the JPG image).
  • For these reasons, I don't see why a few manufacturers still don't rotate images correctly when they are taken ... although I assume all new cameras will.
 
sopax
Experienced
Topic Author
Posts: 36
Joined: 20 Feb 2009, 09:19

Re: Upload pdf-file

04 Jun 2017, 14:59

Thanks for your detailed descriptipn. Just for your info: My camera is the top rated Panasonic compact, less than 6 months old, in the 1000$ range. I shall Keep you informed about the response from their support. I will look for mac-software to rotate prior to upload.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12249
Joined: 30 Sep 2006, 03:37

Re: Upload pdf-file

05 Jun 2017, 01:09

sopax wrote:Just for your info: My camera is the top rated Panasonic compact, less than 6 months old, in the 1000$ range.
Yep, I guess that's why I'm surprised. I knew this was the case for older Android smartphone cameras, but I can't see why some manufacturers don't bother to rotate the image physically.

For a visual overview of the issue:

1. Check your image directly in browser. Displays fine, because the browser will read the EXIF rotation when image is viewed directly in standalone (not within a web page):
http://sopax.dk/X3/content/3.rejser/1.S ... nka039.JPG
Image

2. Head on over to metapicz.com (online EXIF viewer), and load the remote image. You will notice two things:
A ) The image is incorrectly rotated, because browser cannot rotate the image inside a web page.
B ) You will see "rotation" is instead stored as EXIF value.
Image

What cameras SHOULD do (and most do):

1. Here is an image directly from a Canon camera:
http://www.letsgodigital.org/images/pro ... bel-t5.jpg

2. Load this image into metapicz.com, and notice two things:
A ) The image is correctly rotated, although obviously taken by the camera rotated.
B ) You will see in rotation EXIF data that there is no rotation ... Or more precisely, it's set to "Horisontal / normal", which is correct relative to the physical rotation it is saved in.
Image
 
sopax
Experienced
Topic Author
Posts: 36
Joined: 20 Feb 2009, 09:19

Re: Upload pdf-file

05 Jun 2017, 09:59

I have found an easy solution, where I can use my existing software: Open the image in Photoshop, do a little adjustment and save it again. After uploading to X3 it appears in the correct position. It has been an interesting journey to reach this solution - so my thanks to Karl for showing me through the image-technique-jungle!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12249
Joined: 30 Sep 2006, 03:37

Re: Upload pdf-file

25 Nov 2017, 11:08

Automatic image-orientation has now been resolved in latest release X3.24.0. Please read this post for more info.
https://forum.photo.gallery/viewtopic.php?f=51&t=9445