|
Replies:
9
-
Pages:
1
-
Last Post:
26 Mar 17, 09:35
Last Post By: Dschuwi
|
Threads:
[
Previous
|
Next
]
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Detecting "use original"
Posted:
24 Mar 17, 21:42
|
|
|
In most cases, it's easy to detect that an original image is available. You can check for a non-void originalPath - that takes care of Link to originals via scaled images and the single-image Include original case. You can also check for Link to originals (in that case, originalPath is always void).
But there doesn't seem to be an easy way to detect that the user has selected Link to scaled-down images only, but has tagged one image with Use original. The only way I can think of is to examine the imagePath - if you're building a slide page and it starts with ../, you know it's pointing to an original. If you're building an index page and it doesn't start with slides/, again you know it's pointing to an original.
Is there a more direct way that I'm not thinking about?
In the ordinary course of events,e.g., putting together a slide page, this isn't an issue. It crops up only when you're trying to do something like "provide a download icon only if the image to be downloaded is an original."
(I'm not sure I actually want to differentiate that situation, but....)
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: Detecting "use original"
Posted:
24 Mar 17, 23:11
in response to: RobM
|
|
|
Good hint (though wrong!). I could do: currentObject.isUseOriginal()
Now, do I want to detect that, or not....
|
|
|
Posts:
3,815
Registered:
4-Aug-2006
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: Detecting "use original"
Posted:
24 Mar 17, 23:26
in response to: RobM
|
|
|
"Include" is, for one image, just like Link to original via scaled image. "Use" is, for one image, just like Link to original.
But yes, better than doing a kludgy path-check!
|
|
|
Posts:
296
Registered:
12-Nov-2003
|
|
|
Re: Detecting "use original"
Posted:
25 Mar 17, 10:33
in response to: JeffTucker
|
|
|
You can also check for Link to originals (in that case, originalPath is always void).
I wonder why originalPath is void in that case, although in fact an original (hence a path to it) exists.
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: Detecting "use original"
Posted:
25 Mar 17, 12:21
in response to: Dschuwi
|
|
|
You can also check for Link to originals (in that case, originalPath is always void).
I wonder why originalPath is void in that case, although in fact an original (hence a path to it) exists.
I think the logic was that originalPath would be defined only if it pointed to a file other than the one you're seeing on the slide page - in other words, only if it was different from imagePath. For Link to originals and Use original, those two paths would be identical.
But of course for videos, that logic falls apart - originalPath points to the file you're seeing on the slide page. And it's not the original! This has always made me a little crazy.
My gut reaction would be to define originalPath whenever there's an original, even if there's only an original. But maybe that would break something else - I'd have to think about that for a while....
|
|
|
Posts:
296
Registered:
12-Nov-2003
|
|
|
Re: Detecting "use original"
Posted:
25 Mar 17, 18:16
in response to: JeffTucker
|
|
|
My gut reaction would be to define originalPath whenever there's an original, even if there's only an original. But maybe that would break something else - I'd have to think about that for a while....
I am afraid, since this behaviour has been around for a rather very long time, changing it would almost certainly break something. Whatever was coded relying on where it points under which circumstances, workarounds, dependencies - who knows ... I was only curious about the original intention.
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: Detecting "use original"
Posted:
25 Mar 17, 20:11
in response to: Dschuwi
|
|
|
I am afraid, since this behaviour has been around for a rather very long time, changing it would almost certainly break something.
I have exactly the same feeling, but can't quite put my finger on why.
When it comes to the weird situation with videos, I wish David had straightened this out a long time ago. The longer it remains the way it is, the worse it's going to be to fix it. As it stands, there's no way to include both a processed video and its original version (which might, for example, be much higher resolution) in a single album, as you can with images.
|
|
|
Posts:
296
Registered:
12-Nov-2003
|
|
|
Re: Detecting "use original"
Posted:
26 Mar 17, 09:35
in response to: JeffTucker
|
|
|
I wish David had straightened this out a long time ago. The longer it remains the way it is, the worse it's going to be to fix it. As it stands, there's no way to include both a processed video and its original version
You are right, and it turned delicate (irreversably IMHO) with video support.
A similar situation came up with "Hi-Res" images, where originalPath would suddenly point to a not so original downscaled and processed image ...
While all this was certainly done for legit reasons, I suggested quite a while ago to introduce an additional variable like trueOriginalPath - this would not break anything, but whoever stumbled over the meanwhile well-known inconsistencies, could easily adapt their skin if required.
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|