Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

ManagerManager mm_widget_showimagetvs should show a thumbnail not the original image #220

Closed
Cipa opened this Issue Mar 18, 2013 · 8 comments

Comments

Projects
None yet
2 participants

Cipa commented Mar 18, 2013

This will slow the manager if images are big and a lot of them. I am looking for solutions to this.

My first thought was to use the
manager/media/browser/mcpuk/browser.php functionality but there might be a better option.

Is phpthumb integrated? Are there any other options?

Thanks

TimGS commented Mar 18, 2013

phpthumb is not integrated.

I suspect the best option here is to use GD, not phpThumb. GD is in the default PHP install, but the present situation should be used as a fallback option if GD is not present.

I think there may be another issue or maybe a forum Feature Request to make the image display part of the core, and remove it from ManagerManager.

-- Tim.

Cipa commented Mar 18, 2013

If we use GD we have to build a custom script that gets a smaller image and
we will probably do this using a similar solution to the one used by mcpuk
or phpthumb but simpler.
That's what I remember from the old days of building image resize tools
with php. I'm not up do date with the latest technologies regarding this
issue.

On Sun, Mar 17, 2013 at 8:22 PM, TimGS notifications@github.com wrote:

phpthumb is not integrated.

I suspect the best option here is to use GD, not phpThumb. GD is in the
default PHP install, but the present situation should be used as a fallback
option if GD is not present.

I think there may be another issue or maybe a forum Feature Request to
make the image display part of the core, and remove it from ManagerManager.

-- Tim.


Reply to this email directly or view it on GitHubhttps://github.com/ClipperCMS/ClipperCMS/issues/220#issuecomment-15034427
.

Cipa commented Mar 18, 2013

Or maybe use this class only
https://github.com/masterexploder/PHPThumb/blob/master/src/GdThumb.inc.php

On Sun, Mar 17, 2013 at 8:29 PM, Ciprian Badea ciprian.badea@gmail.comwrote:

If we use GD we have to build a custom script that gets a smaller image
and we will probably do this using a similar solution to the one used by
mcpuk or phpthumb but simpler.
That's what I remember from the old days of building image resize tools
with php. I'm not up do date with the latest technologies regarding this
issue.

On Sun, Mar 17, 2013 at 8:22 PM, TimGS notifications@github.com wrote:

phpthumb is not integrated.

I suspect the best option here is to use GD, not phpThumb. GD is in the
default PHP install, but the present situation should be used as a fallback
option if GD is not present.

I think there may be another issue or maybe a forum Feature Request to
make the image display part of the core, and remove it from ManagerManager.

-- Tim.


Reply to this email directly or view it on GitHubhttps://github.com/ClipperCMS/ClipperCMS/issues/220#issuecomment-15034427
.

TimGS commented Mar 18, 2013

Using GD to resize an image without cropping is very easy. We don't have to worry about aspect ratios - just get the image size, calculate a scale factor, and resize. A very few lines of code.

Something like (in PHP-ish pseudo code):
switch(image type)
case jpeg:
ImageCreateFromJpeg();
break;
[GIF and PNG options also]

$scalefactor = 100/imagesize;
imagecreat(...);
imagecopyresampled(...);

The 100 is the thumb height in pixels. A thumb max width could be implemented also, but being realistic it is probably fine (for our purposes) to use a CSS max-width.

Cipa commented Mar 18, 2013

I know it's not that hard. I can start working on this soon. Do you see this part of MM or part of the core. If core where do you think this file should live, maybe manager/thumb.php?

Cipa commented Mar 18, 2013

And I just noticed that multiTv thumb functionality might not work with the new mcpuk. It is using the old path "../assets/images/home/.thumb_box_3.png". So maybe we should provide a resize tool that can be used by other extras.

TimGS commented Mar 18, 2013

Part of the core, definitely.Maybe in a new directory in manager/media/ e.g. manager/media/view/thumb.php?

re: MultiTV - we can maybe add a htaccess rule to workaround this, and direct it to your new thumb.php

TimGS commented Apr 25, 2013

Sorry, I'd forgotten about this thread. The issue of thumbs has been partially fixed in #257 in response to a bug report. Further discussion regarding image TV thumbs should go in that thread.

@TimGS TimGS closed this Apr 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment