2

I've found that if I open an image in Emacs over 1MB it starts to take a while. I justed opened up a 3MB and it took 16seconds. I'm just using the default image-mode is there a better way?

Is there a way to shrink the preview image before putting it into a buffer? Maybe using imagemagick?

Update When I type in './configure --prefix=/opt/emacs-26.0.50 --with-xft' it already says I'm using imagemagick, do I have to recompile with --with-imagemagick? It doesn't seem to change this list if I configure with-imagemagick.

  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc -std=gnu11 -g3 -O2
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          GTK3
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use a png library?                           yes -lpng12
  Does Emacs use -lrsvg-2?                                yes
  Does Emacs use cairo?                                   no
  Does Emacs use imagemagick (version 6)?                 yes
  Does Emacs support sound?                               yes
  Does Emacs use -lgpm?                                   yes
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 no
  Does Emacs use GSettings?                               yes
  Does Emacs use a file notification library?             yes -lglibc (inotify)
  Does Emacs use access control lists?                    no
  Does Emacs use -lselinux?                               no
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use -lm17n-flt?                              yes
  Does Emacs use -lotf?                                   yes
  Does Emacs use -lxft?                                   yes
  Does Emacs use -lsystemd?                               no
  Does Emacs directly use zlib?                           yes
  Does Emacs have dynamic modules support?                no
  Does Emacs use toolkit scroll bars?                     yes
  Does Emacs support Xwidgets (requires gtk3)?            no
  Does Emacs have threading support in lisp?              yes

Update: How I build emacs

Here is how I'm compiling emacs under Debian Jessie (64bit)

cd ~/src/emacs-master
git pull
./autogen.sh
./autogen.sh git
./configure --prefix=/opt/emacs-26.0.50 --with-xft --with-imagemagick
make bootstrap -j32
sudo make install

Output from configure command https://gist.github.com/map7/ebbec3c6ce491180099bde6e7c1a5fa3

  • This is very fast for me. If you have emacs compiled with imagemagick support, then it should automatically scale image to size of frame. I just tried with a 24MB jpeg file and it was effectively instantaneous. I am on macOS, running Railwaycat's packaging of Mitsuharu Yamamoto's "Mac port" (GNU Emacs 25.2.1), installed via brew install emacs-mac --with-imagemagick --with-dbus – deprecated Sep 5 '17 at 13:51
  • I also tried with a vanilla compile of 25.2.1 and that was a bit slower, but still only took about 1 or 2 seconds to display the 24MB image. That one was installed via brew reinstall emacs --with-cocoa --with-gnutls --with-librsvg --with-imagemagick@6 – deprecated Sep 5 '17 at 14:16
  • When I run my configure it already lists imagemagick in the list? Does it make a difference if I specify it on the command line? – map7 Sep 6 '17 at 0:08
  • I have no idea. I just use the homebrew package manager on macOS, but it looks like you are on linux. I would start by checking if the imagemagick library looks like it is being linked into your emacs executable. And when you open an image file, does it say "Image[imagemagick]" in the mode line? You can also try M-: (imagemagick-types) to see the list of image formats that your emacs thinks can be handled with imagemagick. – deprecated Sep 6 '17 at 4:13
  • I don't have any imagemagick-types, so maybe it's not adding it in. I'll have to compile again. – map7 Sep 6 '17 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.