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

Media Dimensions don't work when translation module turned off #286

Closed
simonsmithies opened this Issue Jan 26, 2012 · 16 comments

Comments

Projects
None yet
2 participants
Contributor

simonsmithies commented Jan 26, 2012

Arjan has looked at this and determined the problem is related to the translation module. To repro, deactivate the Translation Module.

As originally documented on the Zotonic forum:
My site's users have inserted a very large facebook link image in their test site (see http://coolair.twigsolutions.co.nz:8000/) , and it's displaying at its native size -- basically ignoring the image size commands from the editor.

I'm aware of the media_dimensions setting in site config, and have
tried using that to force a size, but that doesn't seem to have any
effect either.

@arjan arjan closed this in 17ac5a6 Jan 28, 2012

Contributor

simonsmithies commented Jan 28, 2012

I'm still having problems.

When adding media to a page via the Add/Edit Media dialog (search tab), the link to the new media item doesn't appear on the page until you refresh/exit and return to edit mode.

When clicking on an image in the Add/Edit Media dialog (media on this page tab):
Error evaluating ajax return value: z_dialog_close();window.z_choose_zmedia("381"); z_unmask('fvortb-choose-381');
Followed by:
ReferenceError: res is not defined
The image is not added to the page text.

I've found I can now get images into the page text (tinymce editor) by drag/dropping them from the Add/Edit Media dialog (though no longer from the Attached Media section). Am using this as a workaround for the error above.

Media Dimensions now seem to be getting applied -- all my newly added images seem to be appearing at the "small" size. However I still cannot modify the size applied to each image because selecting an image and clicking the "Image" button still produces the Add/Edit Media dialog, rather than the image properties dialog. (Confirmed in both FF and Chrome on Mac.)

Contributor

simonsmithies commented Jan 28, 2012

Am testing in a brand new clone.

Contributor

simonsmithies commented Jan 28, 2012

The images are being rendered as 80px X 80px jpegs. Two problems with this:

  1. My site.media_dimensions config value is set to "101x101,202x202,401x401". And according to the docs, the default is "100x100,200x200,300x300". Not sure where the 80 is coming from.
  2. The images I'm adding are PNGs.
Owner

arjan commented Jan 28, 2012

try refreshing your browser cache, a lot of javascript has changed

Contributor

simonsmithies commented Jan 28, 2012

I did that.

On Sun, Jan 29, 2012 at 8:18 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

try refreshing your browser cache, a lot of javascript has changed


Reply to this email directly or view it on GitHub:
#286 (comment)

Contributor

simonsmithies commented Jan 30, 2012

I've set up a clean install of imagemagick and zotonic on a completely different server (a free/micro instance on the Amazon AWS/cloud BTW -- Zotonic seems quite happy there). Problem is exactly the same there.

ImageMagick version is 6.5.4-7 2011-01-17 - standard with the distro.

Contributor

simonsmithies commented Jan 30, 2012

Can we re-open this?

Owner

arjan commented Jan 30, 2012

Sure go ahead... Don't have time for it until tomorrow though..

simonsmithies reply@reply.github.com wrote:

Can we re-open this?


Reply to this email directly or view it on GitHub:
#286 (comment)

Contributor

simonsmithies commented Jan 30, 2012

Sorry ... I don't have rights to reopen the case ... can you? :)

I realise you're busy. Really appreciate any time you can give to this.

  • Simon

On Tue, Jan 31, 2012 at 7:42 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

Sure go ahead... Don't have time for it until tomorrow though..

simonsmithies reply@reply.github.com wrote:

Can we re-open this?


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)

@arjan arjan added a commit that referenced this issue Jan 30, 2012

@arjan arjan Fixed typo in TinyMCE. See #286 7f286d0
Owner

arjan commented Jan 30, 2012

I fixed the ReferenceError: res is not defined, that was a stupid typo, sorry. Adding images in the editor should work now, I confirmed that changing the sizes according to the media dimensions works again.

Note that dragging the image from the dialog into the editor is wrong: that way the dimensions will never be applied.

Contributor

simonsmithies commented Jan 31, 2012

Nice to see the error gone.

However now:

  • If I insert image, save and view, then edit page again, the image is removed (after briefly flashing in the editor). Image remains in the rendered page provided I don't save the editor, so it seems something's going awry when the content is loaded into tinymce.
  • If I do things in the right sequence I can get the dimensions dialog to appear, but regardless of the setting there, the image is always rendered as uploaded - i.e. now not resized at all.

Just noticed - the image also gets removed on update from the editor's HTML dialog.

Have re-tested on my original server which is running ImageMagick 6.7.3-2 2011-10-26 (compared with 6.5.4-7 2011-01-17 on the other server where I'm also seeing the same problem). Symptoms are identical on the two machines, as far as I can tell.

Contributor

simonsmithies commented Jan 31, 2012

Hi Arjan,

Have commented on the case as follows ...

Nice to see the error gone.

However now:

  • If I insert image, save and view, then edit page again, the image is
    removed (after briefly flashing in the editor). Image remains in the
    rendered page provided I don't save the editor, so it seems something's
    going awry when the content is loaded into tinymce.
  • If I do things in the right sequence I can get the dimensions dialog
    to appear, but regardless of the setting there, the image is always
    rendered as uploaded - i.e. now not resized at all.

Just noticed - the image also gets removed on update from the editor's HTML
dialog.

Have re-tested on my original server which is running ImageMagick 6.7.3-2
2011-10-26 (compared with 6.5.4-7 2011-01-17 on the other server where I'm
also seeing the same problem). Symptoms are identical on the two machines,
as far as I can tell.

  • Simon

On Tue, Jan 31, 2012 at 11:13 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

I fixed the ReferenceError: res is not defined, that was a stupid typo,
sorry. Adding images in the editor should work now, I confirmed that
changing the sizes according to the media dimensions works again.

Note that dragging the image from the dialog into the editor is wrong:
that way the dimensions will never be applied.


Reply to this email directly or view it on GitHub:
#286 (comment)

Owner

arjan commented Jan 31, 2012

Is this also the case with newly created content?

On 01/31/2012 06:22 PM, simonsmithies wrote:

Hi Arjan,

Have commented on the case as follows ...

Nice to see the error gone.

However now:

  • If I insert image, save and view, then edit page again, the image is
    removed (after briefly flashing in the editor). Image remains in the
    rendered page provided I don't save the editor, so it seems something's
    going awry when the content is loaded into tinymce.
  • If I do things in the right sequence I can get the dimensions dialog
    to appear, but regardless of the setting there, the image is always
    rendered as uploaded - i.e. now not resized at all.

Just noticed - the image also gets removed on update from the editor's HTML
dialog.

Have re-tested on my original server which is running ImageMagick 6.7.3-2
2011-10-26 (compared with 6.5.4-7 2011-01-17 on the other server where I'm
also seeing the same problem). Symptoms are identical on the two machines,
as far as I can tell.

  • Simon

On Tue, Jan 31, 2012 at 11:13 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

I fixed the ReferenceError: res is not defined, that was a stupid typo,
sorry. Adding images in the editor should work now, I confirmed that
changing the sizes according to the media dimensions works again.

Note that dragging the image from the dialog into the editor is wrong:
that way the dimensions will never be applied.


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)

Contributor

simonsmithies commented Jan 31, 2012

Yes, happens the same with a new article, newly uploaded image.

On Wed, Feb 1, 2012 at 6:36 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

Is this also the case with newly created content?

On 01/31/2012 06:22 PM, simonsmithies wrote:

Hi Arjan,

Have commented on the case as follows ...

Nice to see the error gone.

However now:

  • If I insert image, save and view, then edit page again, the image is
    removed (after briefly flashing in the editor). Image remains in the
    rendered page provided I don't save the editor, so it seems
    something's
    going awry when the content is loaded into tinymce.
  • If I do things in the right sequence I can get the dimensions dialog
    to appear, but regardless of the setting there, the image is always
    rendered as uploaded - i.e. now not resized at all.

Just noticed - the image also gets removed on update from the editor's
HTML
dialog.

Have re-tested on my original server which is running ImageMagick 6.7.3-2
2011-10-26 (compared with 6.5.4-7 2011-01-17 on the other server where
I'm
also seeing the same problem). Symptoms are identical on the two
machines,
as far as I can tell.

  • Simon

On Tue, Jan 31, 2012 at 11:13 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

I fixed the ReferenceError: res is not defined, that was a stupid
typo,
sorry. Adding images in the editor should work now, I confirmed that
changing the sizes according to the media dimensions works again.

Note that dragging the image from the dialog into the editor is wrong:
that way the dimensions will never be applied.


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)

Contributor

simonsmithies commented Feb 1, 2012

Arjan I'd like to have a go at fixing this myself. It seems to be a client
side/tinymce problem ... can you give me any pointers as to where to look
first? Am digging through the source now ... Is there a single module that
governs the behaviour and defaults of tinymce?

  • Simon

On Wed, Feb 1, 2012 at 6:55 AM, Simon Smithies simon.smithies@gmail.comwrote:

Yes, happens the same with a new article, newly uploaded image.

On Wed, Feb 1, 2012 at 6:36 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

Is this also the case with newly created content?

On 01/31/2012 06:22 PM, simonsmithies wrote:

Hi Arjan,

Have commented on the case as follows ...

Nice to see the error gone.

However now:

  • If I insert image, save and view, then edit page again, the image
    is
    removed (after briefly flashing in the editor). Image remains in the
    rendered page provided I don't save the editor, so it seems
    something's
    going awry when the content is loaded into tinymce.
  • If I do things in the right sequence I can get the dimensions
    dialog
    to appear, but regardless of the setting there, the image is always
    rendered as uploaded - i.e. now not resized at all.

Just noticed - the image also gets removed on update from the editor's
HTML
dialog.

Have re-tested on my original server which is running ImageMagick
6.7.3-2
2011-10-26 (compared with 6.5.4-7 2011-01-17 on the other server where
I'm
also seeing the same problem). Symptoms are identical on the two
machines,
as far as I can tell.

  • Simon

On Tue, Jan 31, 2012 at 11:13 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

I fixed the ReferenceError: res is not defined, that was a stupid
typo,
sorry. Adding images in the editor should work now, I confirmed that
changing the sizes according to the media dimensions works again.

Note that dragging the image from the dialog into the editor is wrong:
that way the dimensions will never be applied.


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)

Owner

arjan commented Feb 1, 2012

I'm online on the chat right now or tomorrow morning (thursday from 9am CET)

On 02/01/2012 07:25 PM, simonsmithies wrote:

Arjan I'd like to have a go at fixing this myself. It seems to be a client
side/tinymce problem ... can you give me any pointers as to where to look
first? Am digging through the source now ... Is there a single module that
governs the behaviour and defaults of tinymce?

  • Simon

On Wed, Feb 1, 2012 at 6:55 AM, Simon Smithies simon.smithies@gmail.comwrote:

Yes, happens the same with a new article, newly uploaded image.

On Wed, Feb 1, 2012 at 6:36 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

Is this also the case with newly created content?

On 01/31/2012 06:22 PM, simonsmithies wrote:

Hi Arjan,

Have commented on the case as follows ...

Nice to see the error gone.

However now:

  • If I insert image, save and view, then edit page again, the image
    is
    removed (after briefly flashing in the editor). Image remains in the
    rendered page provided I don't save the editor, so it seems
    something's
    going awry when the content is loaded into tinymce.
  • If I do things in the right sequence I can get the dimensions
    dialog
    to appear, but regardless of the setting there, the image is always
    rendered as uploaded - i.e. now not resized at all.

Just noticed - the image also gets removed on update from the editor's
HTML
dialog.

Have re-tested on my original server which is running ImageMagick
6.7.3-2
2011-10-26 (compared with 6.5.4-7 2011-01-17 on the other server where
I'm
also seeing the same problem). Symptoms are identical on the two
machines,
as far as I can tell.

  • Simon

On Tue, Jan 31, 2012 at 11:13 AM, Arjan Scherpenisse <
reply@reply.github.com

wrote:

I fixed the ReferenceError: res is not defined, that was a stupid
typo,
sorry. Adding images in the editor should work now, I confirmed that
changing the sizes according to the media dimensions works again.

Note that dragging the image from the dialog into the editor is wrong:
that way the dimensions will never be applied.


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)


Reply to this email directly or view it on GitHub:
#286 (comment)

@kaos kaos pushed a commit to kaos/zotonic that referenced this issue Feb 8, 2012

@arjan arjan Again fix the embedding of images in TinyMCE. Fixes #286 747564d

@rpip rpip pushed a commit to rpip/zotonic that referenced this issue Aug 12, 2013

@arjan arjan Replaced TinyMCE with latest version. Fixed zmedia plugin.
Fixes #286

Squashed commit of the following:

commit d5916e7759d46480c9af8639932409ec7eee3976
Author: Arjan Scherpenisse <arjan@scherpenisse.net>
Date:   Sat Jan 28 10:59:25 2012 +0100

    Remove console.log

commit 4be5c7102d1e0edc1b20304d9eefb89111965b9f
Author: Arjan Scherpenisse <arjan@scherpenisse.net>
Date:   Sat Jan 28 10:55:41 2012 +0100

    Replaced TinyMCE with latest version. Fixed zmedia plugin.
b39512f

@rpip rpip pushed a commit to rpip/zotonic that referenced this issue Aug 12, 2013

@arjan arjan Fixed typo in TinyMCE. See #286 53a3c2c

@rpip rpip pushed a commit to rpip/zotonic that referenced this issue Aug 12, 2013

@arjan arjan Again fix the embedding of images in TinyMCE. Fixes #286 cd726d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment