Harm10 wrote:hansfn wrote:And, Harm, please check if fancybox can behave better for people working the way Schop does - Fancybox should be a drop-in replacement for the default thickbox.
I will if Schop provides me with somewhat more detail or a link on what goes wrong. It could be that he wants the popup logic in the editor changed which is something I was hoping to do some time (but still have to locate the place in the core where to do it).
The pop-up logic does not need to change. Like Hans said, the fancybox extension should be a drop-in, out-of-the-box replacement for Thickbox.
The solution is simpler than it looks (I think). The code in snippet_fancybox.php from line 177 to 216 should be changed. If there is a thumbnail, you should assume it has the right size. The html <img> tag does not need the width and height parameters.
To illustrate this: when I setup PivotX and make templates, I take precautions so that thumbs display properly. I make sure they can not get too wide for the area they are supposed to be displayed in. This has always worked great. Thickbox displays the pop-ups like I expect them to. In the example in a previous post in this topic, I showed the thumb of 300 * 240 pixels. My settings in file uploads are: 'width = 300 pixels, height = 999 pixels', so if I upload an image, and use the 'bounded size' option, the thumb will never get wider than 300 pixels. If the user chooses the 'fixed proportions' option, the thumbnail will be 300 * 999 pixels, which is fine, because the user can see that while creating the thumb. If they choose to use 'free crop', they are on their own, which is the intent of that option. So far, everything is fine, the thumbnail is created with the size you want, happiness all around.
Until you activate Fancybox. Because now, it all of a sudden decides that my thumbs need to be displayed 300 pixels * 999 pixels, distorting the aspect ratio of the thumbnail. Trust me, I have not met a user yet that understands this. Even power users, like bloggers on AmsterdamCentraal.nl for example, have questioned this behavior. We had a discussion about it before, and I was not able to get my point across at the time, so I just modified Fancybox.
Summarizing this whole rant: Thumbnails that were created by a user (with whatever method they used: imagetools, automatic, cropper, whatever), should be displayed the way they were created. If I choose to create a 20 * 20 pixels thumbnail, it better be displayed that way, and not distorted by a script.
If you want me to, I can modify snippet_fancybox.php, and we will never have to worry about the issue again.